I am currently working with Mumble VoIP 1.2.X server-client communication protocol. My job is to create a desktop client where the client is connected with the server and receive other client's audio streams. I am receiving the stream in opus codec. I can decode it and also can play using NAudio library. Now I need to transcode the opus codec stream into G.711 ulaw codec. So that, I can play the transcoded stream in multicast radio channel using UDP.
Asked
Active
Viewed 652 times
1 Answers
0
Using c#, you could run ffmpeg.exe, which should let you:
- Take the Opus stream as input
- Transcode it to G.711u
- Forward it to your radio using UDP
Here is an example which does the last two steps:
//listen to the microphone, transcode to G.711u, send it over UDP to a multicast listener
ffmpeg -f dshow -i audio="Microphone (Logitech USB Headset H340)" -ac 1 -ar 8000 -ab 64 -acodec pcm_mulaw -f rtp rtp://239.0.0.1:5656
And here are some other examples which may be of use:
//list input devices
ffmpeg -list_devices true -f dshow -i dummy
//record microphone to mp3
ffmpeg -f dshow -i audio="Microphone (Logitech USB Headset H340)" -c:a libmp3lame -ar 44100 -b:a 320k -ac 1 output1.mp3
//play audio going to the radio
ffplay rtp://239.0.0.1:5656
//play audio coming from the radio
ffplay rtp://239.0.0.2:5656
//receive rtp multicast g.711 and save to mp3
ffmpeg -i rtp://239.0.0.1:5656 -filter:a "asetrate=8000" -acodec libmp3lame -ar 44100 output2.mp3

Fidel
- 7,027
- 11
- 57
- 81