morrolinux / mpradio

Morrolinux's Pirate radio (PiFmRDS / PiFmAdv implementation with Bluetooth and mp3 support) - Stream music to your car's FM radio or use it as a Bluetooth speaker via headphone jack
GNU General Public License v3.0
108 stars 17 forks source link

can this recive airwaves from a anntena and transmit via BT? #63

Open tarbear123 opened 3 years ago

tarbear123 commented 3 years ago

`int play_bt(string device) { string sox_params=""; string output="sudo /usr/local/bin/"+s.implementation+" "+s.opSwitch+"ps 'BLUETOOTH' "+s.opSwitch+"rt 'A2DP BLUETOOTH' "+s.opSwitch+"freq "+s.freq+" "+s.opSwitch+"audio -"; set_output(output); /*< change output device if specified / set_effects(sox_params);

ps.songName = "Bluetooth";
update_now_playing();

string cmdline="arecord -D bluealsa:HCI=hci0,DEV="+device+" -f cd -c 2 | sox -t raw -v "+s.btGain+" -G -b 16 -e signed -c 2 -r 44100 - -t wav - "+sox_params+" | "+output;
cout<<"CMDLINE: "<<cmdline<<endl;
//string cmdline="arecord -D bluealsa -f cd -c 2 | sox -t raw -v "+s.btGain+" -G -b 16 -e signed -c 2 -r 44100 - -t wav - "+sox_params+" | "+output;  //legacy mode

system(cmdline.c_str());
return 0;`
tarbear123 commented 3 years ago

`int play_bt(string device) { string sox_params=""; string output="sudo /usr/local/bin/"+s.implementation+" "+s.opSwitch+"ps 'BLUETOOTH' "+s.opSwitch+"rt 'A2DP BLUETOOTH' "+s.opSwitch+"freq "+s.freq+" "+s.opSwitch+"audio -"; set_output(output); /*< change output device if specified / set_effects(sox_params);

ps.songName = "Bluetooth";
update_now_playing();

string cmdline="arecord -D bluealsa:HCI=hci0,DEV="+device+" -f cd -c 2 | sox -t raw -v "+s.btGain+" -G -b 16 -e signed -c 2 -r 44100 - -t wav - "+sox_params+" | "+output;
cout<<"CMDLINE: "<<cmdline<<endl;
//string cmdline="arecord -D bluealsa -f cd -c 2 | sox -t raw -v "+s.btGain+" -G -b 16 -e signed -c 2 -r 44100 - -t wav - "+sox_params+" | "+output;  //legacy mode

system(cmdline.c_str());
return 0;`

hello?