simple codec2 to udp pint to pint ethernet link

51 views
Skip to first unread message

imran qureshi

unread,
Aug 22, 2021, 2:03:16 PM8/22/21
to digitalvoice

Hi,
is there any way I can pipe the audio to ethernet and it sends over udp to specified ip:port. on the reciever side i can receive using udp:port and pipe to aplay. I hope it have done in the initial development of this project, it would be great if can share this.

What I am trying is from codec2:
Tx side
./src/c2enc 3200 ../wav/all.wav - | [ to udp sink]

or 

br=3200; arecord -f S16_LE -c 1 -r 8000 | ./src/c2enc $br - - | [python udp stream app]

Rx side:
[python udp receive app] | ./src/c2dec 3200 - - | aplay -f S16_LE

This will be very simple to send encoded voice over point to point ethernet link.

or, is there any python application for c2encod and c2decod sothat i can do the udp streaming 


John D. Hays

unread,
Aug 22, 2021, 2:49:32 PM8/22/21
to digita...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "digitalvoice" group.
To unsubscribe from this group and stop receiving emails from it, send an email to digitalvoice...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/digitalvoice/fefbebba-a25e-4ffa-a693-b6c2c9f9705dn%40googlegroups.com.

david

unread,
Aug 22, 2021, 5:37:11 PM8/22/21
to digita...@googlegroups.com
Yes I've done it with netcat

imran qureshi

unread,
Aug 23, 2021, 4:06:43 PM8/23/21
to digitalvoice
Hi,
Thanks for your reply.
I had tried netcat but I was not able to do streaming the audio packets from the mic.
when I used the recorded wavefile it worked and I can listen to received audio but the behaviour is not streaming, netcat sends all the packets once and on the receive side it plays from the queue.
Can you please let me know how can I do the mic audio to c2enc and streaming packets over ethernet?
I have found freedv_700d_rx.py, is there a similar python binding code to use the c2enc and c2dec so that I can do the streaming whin the python framework?

Actually, I have my custom FSK modem which receives the packets from ethernet and sends them over the air and vice versa. So I would like to send live laptop mic codec2 encoded frames and send them to the ethernet modem.

looking forward,  Thanks again
 


Mooneer Salem

unread,
Aug 23, 2021, 6:22:29 PM8/23/21
to digita...@googlegroups.com
Hi Imran,

I haven't tried it yet to confirm but it should be possible to have c2enc read from standard input (- instead of a filename). This will allow it to work in conjunction with something like 'arecord' to pass raw microphone audio through the encoder, over the network with netcat or another tool and then have it decoded at the other end. The main issue with netcat is that it will terminate when it gets an EOF, hence why you likely saw the behavior that you did. Hopefully I'm interpreting your question correctly, but if not, please feel free to clarify further.

Thanks,

-Mooneer K6AQ

--
You received this message because you are subscribed to the Google Groups "digitalvoice" group.
To unsubscribe from this group and stop receiving emails from it, send an email to digitalvoice...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages