FM Transmitter. Use the Raspberry Pi as an FM transmitter. Works on every Raspberry Pi board.
 
 
Go to file
Marcin Kondej 121982a2c5 Added more clear description
Fixed issue #59
2018-12-29 03:18:27 +01:00
.gitignore Added more clear description 2018-12-29 03:18:27 +01:00
README.md Added more clear description 2018-12-29 03:18:27 +01:00
acoustic_guitar_duet.wav Added more clear description 2018-12-29 03:18:27 +01:00
error_reporter.cpp Simplified code 2018-02-05 23:28:06 +01:00
error_reporter.h Added more clear description 2018-12-29 03:18:27 +01:00
main.cpp Added more clear description 2018-12-29 03:18:27 +01:00
makefile Added more clear description 2018-12-29 03:18:27 +01:00
pcm_wave_header.h Simplified code 2018-02-05 23:28:06 +01:00
transmitter.cpp Added more clear description 2018-12-29 03:18:27 +01:00
transmitter.h Added more clear description 2018-12-29 03:18:27 +01:00
wave_reader.cpp Added more clear description 2018-12-29 03:18:27 +01:00
wave_reader.h Added more clear description 2018-12-29 03:18:27 +01:00

README.md

fm_transmitter

Use Raspberry Pi as FM transmitter. Works on any Raspberry Pi board.

This project uses the general clock output to produce frequency modulated radio communication. It is based on idea originaly posted here: http://icrobotics.co.uk/wiki/index.php/Turning_the_Raspberry_Pi_Into_an_FM_Transmitter, but does not use DMA controller in order to distribute samples to output (clock generator), so sound quality is worse as in PiFm project and only mono transmition is available but this makes possible to run it on all kind of boards.

How to use it

To use this project You will have to buid it. First, clone this repository, then use "make" command as shown below:

git clone https://github.com/markondej/fm_transmitter
cd fm_transmitter
make

After successful build You can start transmitting by typing:

sudo ./fm_transmitter -f 102.0 acoustic_guitar_duet.wav

Where:

  • -f 102.0 - Specifies the frequency in MHz, if not passed default is 100.0
  • acoustic_guitar_duet.wav - Sample WAVE file, You can use your own

Supported audio files

You can transmitt uncompressed WAVE (.wav) files directly or read audio data from stdin, eg.:

sox star_wars.wav -r 22050 -c 1 -b 16 -t wav - | sudo ./fm_transmitter -f 100.6 -

Notice only uncompressed WAVE files are supported. If You expire "corrupted data" error try converting file, eg. by using SoX:

sox my-audio.mp3 -r 22050 -c 1 -b 16 -t wav my-converted-audio.wav
sudo ./fm_transmitter -f 100.6 my-converted-audio.wav

USB microphone

To use a USB sound card microphone input use arecord, eg.:

arecord -D hw:1,0 -c1 -d 0 -r 22050 -f S16_LE | sudo ./fm_transmitter -f 100.6 -

In case of performance drop down use plughw:1,0 instead of hw:1,0.

Please keep in mind that transmitting on certain frequencies without special permissions may be illegal in your country.

New features

  • works on any Raspberry Pi model
  • reads mono and stereo files
  • reads data from stdin
  • based on threads

Included sample audio was created by graham_makes and published on freesound.org