Skip to main content
7 of 9
added 52 characters in body

SOLVED : Audio from audio source to pipe is stuttering

I am trying to get an audio stream from Bluetooth to the stdin of fm_transmitter on my Raspberry Pi 3 / up-to-date Raspbian Stretch.

So far, I got FM-Transmitter running with an ICE-Cast-Stream using ffmpeg & my Pi is playing Music from Spotify via bluetooth (I installed blueman next to the things I followed from this Tutorial).

To archive this, I tried using ffmpeg -f s16le -i hw:0 - | fm_transmitter -f 87.6 - as mentioned in tutorials, and tested with all the other devices listed with aplay -L. But it can not listen to any of the sources / can't find it.

So as main concern, I am wondering which tool can link an audio-source to the pipe.


- EDIT -

ffmpeg seems not to be able to do what I need and aplay -L wasn't capable of finding Bluetooth sources. But with pactl list sources short I finally found the A2DP-source.

Anyways, after messing around with sox, I finally got an audio signal from default-device to bash, but it was stuttering as I used the following command.

$ sox -d -t raw -r 22.05k -b 8 - gain -5 | sudo fm_transmitter -f 87.6 - 

- SOLVED EDIT -

After I thought of the sampling rate at first place being 44.8k, and the piped rate being 22.05k - which is not perfectly dividable - I tried different tempo rates.

I found tempo 0.97 being fine for me (still it stutters the first seconds but then it works flawless).

$ sox -d -t raw -b 8 -r 22050 - gain -5 tempo 0.97 | sudo fm_transmitter -f 87.6 - Playing: stdin, 22050 Hz, 16 bits, mono Input File : 'default' (alsa) Channels : 2 Sample Rate : 48000 Precision : 16-bit Sample Encoding: 16-bit Signed Integer PCM In:0.00% 00:07:15.97 [00:00:00.00] Out:9.90M [ =====|===== ] Hd:4.4 Clip:0 

Still, if there is someone who has a better idea how to get this running, don't mind answering. :)