You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to build a telco app and I need to convert audio codecs used in telco to raw pcm s16le for processing using voice-activity-detection, speech-to-text and other technologies. I managed to build a converter using libav from ALaw to PCM like this:
I'm not sure why, but I had to strip few bytes of the end of each packet:
# working solutionreturnbytes(output_buffer[:-128]) ifoutput_bufferelseNone
But it works and the output audio is clear and VAD/STT works without any issue.
Now I'm trying to build the same for G722 codec, but I haven't been able to get the code to work. My first attempt was simply replacing the decoder in the code above, but that did not work. So I tried to use LLM to generate the code for me, but that also resulted in non working solution:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm trying to build a telco app and I need to convert audio codecs used in telco to raw pcm s16le for processing using voice-activity-detection, speech-to-text and other technologies. I managed to build a converter using libav from ALaw to PCM like this:
I'm not sure why, but I had to strip few bytes of the end of each packet:
But it works and the output audio is clear and VAD/STT works without any issue.
Now I'm trying to build the same for G722 codec, but I haven't been able to get the code to work. My first attempt was simply replacing the decoder in the code above, but that did not work. So I tried to use LLM to generate the code for me, but that also resulted in non working solution:
Any ideas how to get this to work?
I also tried running ffmpeg as a subprocess and simply sending audio to STDIN and getting it back from STDOUT like this
But that caused delay and I haven't been able to figure out where the delay comes from.
Thanks for any ideas 🙏
Beta Was this translation helpful? Give feedback.
All reactions