1

When I run a audio file with like mpg321 or aplay or sox or even in TTS's (Text to speak) audio only outputs correctly from the second time I reproduce the audio file...

per example in Text to speech: If write "Hello World!" it only speaks "orld" or if I write "you are a good boy" it only speaks "a good boy"... Why?

How can I fix this?

in TTS's this happens with all TTS: espeak, Google Api, VoiceRSS Api, etc... and happens in my old raspberry (Raspbian) too , not only in my Ubuntu (14.04.1 LTS)

I guess is because audio engine or something like that has a delay of 0.5 - 2 sec to start. And then skips the fisrt second or two of the audio.

And if I run the same audio twice or triple, etc , from the second time it runs well, but only if I am quickly...

I need it for Text to Speak.

Both Raspberry Pi and Ubuntu Machine are connected by HDMI.

How can I solve it? To speak all the words? And the audios from the begin of beginnings?

2

Your output device which you've connected via HDMI needs a couple of seconds to synchronize to the datastream it starts receiving from your system. You could look into adding a couple of seconds of silence first, or to continually play silence during your application to keep the synchronization going, and then mixing in the TTS output when that's needed.

EDIT: Seems related to this question, the suggestions there may also help: askubuntu.com

  • Thanks, How can I add A couple of silence to this: #!/bin/bash; say() { local IFS=+; mpg321 "http://api.voicerss.org/?src=$*"; }; say $* – DiogoSaraiva Feb 13 '15 at 12:48
  • Can you tell me how I can add silence in this code please: gist.github.com/DiogoSaraiva/aa0dbf6cb95fa642d223 – DiogoSaraiva Feb 13 '15 at 12:55
  • 1
    I have no experience with TTS, but won't adding spaces translate into silence? It looks like you can specify what audio format that API should return, so you could record some silence in that same format and then first play that, and then do the say() call. – wurtel Feb 13 '15 at 13:00
  • please help, I tryed to add spaces, a silence, a tone before and didn't worked.... :( – DiogoSaraiva Feb 13 '15 at 14:12
  • 1
    Have you tried the suggestions in the askubuntu.com link? – wurtel Feb 13 '15 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.