Espeak usage samples

2013-09-02

Espeak usage samples

It is tested on Ubuntu 12.04.

Before test you need check out code and build from: https://github.com/mondhs/espeak.

Sample uses header files from source dir(). Example where source should be located: /home/user/src/espeak/src

Files

sampleSpeak.cpp

audacityLabelSpeak.cpp

  • audacityLabelSpeak.cpp Shows how to write callback function.
  • It stores generated audio file to wav and phoneme transcriptions.
  • Compile(be sure you replace ):
  • g++ -g -I. -I audacityLabelSpeak.cpp -lportaudio -lespeak -o audacityLabelSpeak
  • Run: ./audacityLabelSpeak
  • As result will be generated audio audacityLabelSpeak.au and audacity segmentation file audacityLabelSpeak.phn.txt

talkingClockEspeak.py

Code Analysis

  • Mbrola Events are triggered:
  • speak_lib#espeak_Synth()
  • ->speak_lib#sync_espeak_Synth()
  • ->speak_lib#Synthesize(text)
  • ->synthesize#Generate(phoneme_list)
  • ->synth_mbrola#MbrolaGenerate(phoneme_list===plist)
  • ->synth_mbrola#MbrolaTranslate()
  • ->synthesize#DoPhonemeMarker()
  • Mbrola phoneme generation:
  • speak_lib#Synthesize(text)
  • ->synthesize#SpeakNextClause(text===p_text)(What is this: phoneme_callback)
  • ->TranslateClause(p_text)
  • … ->translate#MakePhonemeList(){phlist = phoneme_list}
  • tranlator created in translate#LoadVoices()