I’m working on an fm rds transmitter. I started by transmitting a simple, mono wav file (converted from the original mp3 to a mono-channel, 32-bit float uncompressed file). For this I open the file using gr.file_source

I am still having a problem that the sound seems slowed down to a rate of sqrt(2), but hope to solve this next week…

Moving on from mono to stereo, I see that gr.file_source doesn’t understand >1 channels in a wav file. However, a simple search in the discuss-gnuradio mailing list showed me that Martin Braun of UniKarlsruhe contributed gr.wavfile_source() and gr.wavfile_sink() to trunk back in Feb 2008.

Strangely, converting from mp3 to stereo wav using audacity didn’t work very well (the file played fine in totem, but gr.wavfile_source was complaining “RuntimeError: is not a valid wav file”). The solution was to install sox and libsox-fmt-mp3 and then run sox input.mp3 -2 output.wav.

Advertisements