diff --git a/examples/Example_Usage.md b/examples/Example_Usage.md index a6ce817..c6d9f46 100644 --- a/examples/Example_Usage.md +++ b/examples/Example_Usage.md @@ -223,3 +223,13 @@ francis@12coresx:~$ ffmpeg -f pulse -i 0 -c:a libmp3lame -ab 64k -f mp3 icecast: ``` + +## Sending Audio to UDP Target/Port + +Audio can be sent to a target address on your local area network with the UDP blaster using the `-o udp:targetaddress:port` option. + +Example: +`dsd-fme -fs -o udp:192.168.7.8:23470` + +Receiving End: +`socat stdio udp-listen:23470 | play -q -b 16 -r 8000 -c2 -t s16 -` \ No newline at end of file diff --git a/src/dsd_main.c b/src/dsd_main.c index b251337..eb3a797 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -678,7 +678,7 @@ initOpts (dsd_opts * opts) //UDP Socket Blaster Audio opts->udp_sockfd = 0; opts->udp_portno = 23456; //default port, same os OP25's sockaudio.py - sprintf (opts->udp_hostname, "%s", "0.0.0.0"); + sprintf (opts->udp_hostname, "%s", "127.0.0.1"); //tcp input options opts->tcp_sockfd = 0; @@ -1203,8 +1203,8 @@ usage () printf (" /dev/dsp for OSS audio (Depreciated: Will require padsp wrapper in Linux) \n"); #endif printf (" null for no audio output\n"); - printf (" udp for UDP socket blaster output (default host 0.0.0.0 (broadcast) default port 23456)\n"); - printf (" udp:127.0.0.1:23470 for UDP socket blaster output (Custom Address and Port\n"); + printf (" udp for UDP socket blaster output (default host 127.0.0.1; default port 23456)\n"); + printf (" udp:192.168.7.8:23470 for UDP socket blaster output (Target Address and Port\n"); printf (" -d Create mbe data files, use this directory (TDMA version is experimental)\n"); printf (" -r Read/Play saved mbe data from file(s)\n"); printf (" -g Audio Output Gain (Default: 0 = Auto; )\n"); @@ -2658,6 +2658,12 @@ main (int argc, char **argv) opts.audio_out_type = 8; + if (opts.monitor_input_audio == 1 || opts.frame_provoice == 1) + { + fprintf (stderr, "NOTICE: Raw Audio Monitoring and Analog Calls Unavailable over UDP Audio Output\n"); + opts.monitor_input_audio = 0; + } + } if((strncmp(opts.audio_out_dev, "pulse", 5) == 0)) diff --git a/src/dsd_rigctl.c b/src/dsd_rigctl.c index 1dec87c..404ea69 100644 --- a/src/dsd_rigctl.c +++ b/src/dsd_rigctl.c @@ -337,4 +337,13 @@ int udp_socket_connect(dsd_opts * opts, dsd_state * state) return (err); } + // For some reason, setting a broadcast to all isn't working + // int broadcastEnable = 1; + // err = setsockopt(opts->udp_sockfd, SOL_SOCKET, SO_BROADCAST, &broadcastEnable, sizeof(broadcastEnable)); + // if (err < 0) + // { + // fprintf (stderr, " UDP Broadcast Set Error \n"); + // return (err); + // } + }