In what type is encoded the audio output? #215
-
I making a script that takes PDF text and make from it sentences and passes into TTS but how i can concatenate the final audio to save it correctly? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The correct way is to keep audios in memory as WAV files and just concatenate them before writing. You may have to convert to int16 before writing. If this is too memory intensive, you can write a WAV file in a streaming fashion. If you would like to save in a more proper format like ogg/opus or ogg/vorbis, this may require a bit more fiddling to do to find a streaming writer. Options to explore - torchaudio, pysounsfile, wave, scipy WAV writer, if you use python. |
Beta Was this translation helpful? Give feedback.
The correct way is to keep audios in memory as WAV files and just concatenate them before writing. You may have to convert to int16 before writing.
If this is too memory intensive, you can write a WAV file in a streaming fashion.
If you would like to save in a more proper format like ogg/opus or ogg/vorbis, this may require a bit more fiddling to do to find a streaming writer.
Options to explore - torchaudio, pysounsfile, wave, scipy WAV writer, if you use python.