javascript - Female voice in Speak.js -
we using speak.js library text speech purpose. , need implement female voice localization in this. calling speak function mespeak.speak('hello thomas");
not able make it's op in female voice. have observed need pass arg parameter not able pass too. can please guide how can female voice op using speak.js lib ?
many in advance
supposing you're talking mespeak.js:
download latest version @ http://www.masswerk.at/mespeak
make copy of voice-file (json) in language of choice , open in editor.
the voice-files of following structure:
{ "voice_id": "<filename>", "dict_id": "<filename>", "dict": "<base64-encoded octet stream>", "voice": "<base64-encoded octet stream>" }
first, provide unique "voice_id" (e.g. "en-us-f", ids unix-filenames).
the encoded voice data text-file found in espeak's data-directory (see http://espeak.sourceforge.net/). while files represented base64-encoded octet-streams, may use text-string providing property "voice_encoding":
{ "voice_id": "<filename>", "dict_id": "<filename>", "dict": "<base64-encoded octet stream>", "voice": "<text-string>", "voice_encoding": "text" }
now, referring espeak-data , espeak-docs voices, may find following text voice "en-us":
// moving towards english name english-us language en-us 2 language en-r language en 3 gender male [and more]
by removing comment in first line, editing name (we want unique) , changing gender, you'll arrive at:
name english-us-f language en-us 2 language en-r language en 3 gender female
replace line-breaks "\n" valid json-string:
"name english-us-f\nlanguage en-us 2\nlanguage en-r\nlanguage en 3\ngender female"
and use value of property "voice". save file , load mespeak.
you may fine-tune voice according espeak-docs: http://espeak.sourceforge.net/voices.html
(an alternate way involve saving plain espeak-voice file , encoding content base64-string , using value "voice". in case not set "voice_encoding" property. using plain-text might more suitable testing.)
hope helps (it won't easier this).
n.l.
edit: please mind malformed voice-string cause error in (m)espeak. (espeak not gracious on syntax errors, throw "type-error" – handled console-log mespeak. keep in mind core of mespeak emscripten-generated port of espeak. doesn't handle voice-files better.)
edit: (extended) version of part of mespeak-documentation: http://www.masswerk.at/mespeak/voices-and-languages.html
Comments
Post a Comment