But there is some trial and error: I'd look at the docuemtation of the pymedia module to check if tehre are any quality configurations that you can set.Īnd the other thign is that unlike wave or raw audio, you won't be able to simply concatenate mp3 encoded audio: whatever the solution you reach, you will have to concatenate/mix your sounds while they are uncompressed (unencoded), and afterwards generate the mp3 encoded audio.Īlso, sometimes we just have the feeling that recordign a fiel to disk and reconvertignit, instead of doing it in "one step" is awkward - while in pratie, the software does exsactly that behind the scenes,even if we don't specify a file ourselves. Many thanks to for your answers to my questions.Ĭan't provide a definitive answer here, sorry. I have seen also that tksnack libraries, can concatenate audio, but they are not able to write mp3 files. Obviously, it would be great if I could concatenate audio memory streams of text (after text-to-speech module) and the stream of a warning sound, before encoding the whole audio memory stream in an unique mp3 file. This possibility (if it would work correctly), it would be good to skip wav files transformation step.Ģ) As second problem, I need to concatenate audio mp3 file (obtained from text-to-speech module) with a particular warning sound. I can not understand where is the problem?!? Tts.SpeakToWave(file, text) or tts.SpeakToMemory(text)Įxploiting tts.SpeakToMemory(text) function, and using PyMedia I have been able to save an mp3 directly but mp3 file (when reproducing), sounds uncomprensible like donald duck! :-)
Now, the problem is that, I would like to insert (in particular point of an audio mp3 file, between two words) a particular external sound file (like a sound warning) or (if possible a generated warning sound).ġ) I have seen that PyTTS have possibilities to save audio stream on a file or in a memory stream.
So after that, I code these wav files, in mp3 format, using lame command line encoder. wav files (in pyTTS is not possible to encode in mp3 format directly). I use pyTSS as a python Text-To-Speech module, to transform text in audio. I work on text-to-speech trasforming text, in audio mp3 files, using python 2.5.