miegl / PiFmAdv

Advanced Raspberry Pi FM transmitter with RDS encoding
GNU General Public License v3.0
493 stars 84 forks source link

Transmit Discontinuous Audio #64

Open JohnDN90 opened 5 years ago

JohnDN90 commented 5 years ago

I am using a "radio scanner" like application (OP25) to receive and decode digital to audio and then I am trying to re-broadcast the audio to my FM radio using PiFmAdv. OP25 outputting the audio via wireshark, and then I use nc piped to sox piped to PiFmAdv to transmit the audio.

The audio input to PiFmAdv is not constant, like an audio file or an always on microphone. It is essentially acting like a microphone being keyed and unkeyed. The issue I am having is that when the audio is "unkeyed", PiFmAdv just broadcasts the last 0.5 seconds or so of the audio continuously like an echo, until it gets new audio from OP25 to transmit.

Is there a way around this? Perhaps a way to tell PiFmAdv to transmit silence when audio input is not present?

Edited for clarity.

miegl commented 5 years ago

Hm, I'm curious if Sox provides a constant audio stream in this case... If Sox isn't providing a constant audio stream and PiFmAdv has to wait for Sox to provide more samples then the best solution is to make the audio stream constant before piping it to PiFmAdv. Anyhow I'll look into it when I have more time.