Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any language with female gender? #51

Open
ehsaanQCTechnologies opened this issue Jan 2, 2017 · 2 comments
Open

Is there any language with female gender? #51

ehsaanQCTechnologies opened this issue Jan 2, 2017 · 2 comments

Comments

@ehsaanQCTechnologies
Copy link

import pyttsx
engine = pyttsx.init()
voices = engine.getProperty('voices')
male_language_count = 0
female_language_count = 0
none_language_count = 0
for voice in voices:
    if voice.gender == 'male':
    	# female language count
        male_language_count += 1
    elif voice.gender == 'female':
    	# female language count
		female_language_count +=1
	else:
        # None language count
        none_language_count += 1

print 'Male gender language count : %d' %  male_language_count
print 'Female gender language count : %d' % female_language_count
print 'None gender language count : %d' % none_language_count

Output

Male gender language count : 60
Female gender language count : 0
None gender language count : 9

How i change the english and spanish language gender to female?

@franc-carter
Copy link

If you are using linux/espeak it looks like there are no specific female voices included. However you can simulate them by adding '+f1' up to '+f4' on the end of the the voice. I use

engine.setProperty('voice', 'english+f1')

@jdr53
Copy link

jdr53 commented Jun 2, 2020

The +f1 thru +f4 do add intonation but be aware that the results vary by the basic voice. So for example, "english_rp+f3" or even +f4 is rather acceptable (to me), but en-westindies+f3 is abrasive and doesn't sound feminine at all. I suggest you write a loop that repeats a fairly long text message, and repeat it for each voice and each intonation. Then choose. Or put in some randomness to kill the boredom factor. Unfortunately, there don't appear to be any available third-party voices for pyttsx3. I have found that it sometimes helps (both male and female) to fiddle with phonemes by way of creative spelling. For example, "as you wishhh" instead of "as you wish", or spelling out "okay" instead of using "ok". Your last resort may be to design your own voice / phonemes palette but that is arduous and you'll probably have a difficult time finding phoneme editors and guidance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants