fm_transmitter/README.md

51 wiersze
2.2 KiB
Markdown
Czysty Zwykły widok Historia

2015-03-30 23:17:34 +00:00
# fm_transmitter
Use Raspberry Pi as FM transmitter. Works on any Raspberry Pi board.
2015-07-22 15:38:41 +00:00
2019-01-05 03:12:20 +00:00
This project uses the general clock output to produce frequency modulated radio communication. It is based on idea originaly presented by [Oliver Mattos and Oskar Weigl](http://icrobotics.co.uk/wiki/index.php/Turning_the_Raspberry_Pi_Into_an_FM_Transmitter) on [PiFM project](http://icrobotics.co.uk/wiki/index.php/Turning_the_Raspberry_Pi_Into_an_FM_Transmitter).
2015-07-22 15:38:41 +00:00
## How to use it
2018-12-29 02:30:03 +00:00
To use this project You will have to build it. First, clone this repository, then use "make" command as shown below:
2015-08-07 04:39:55 +00:00
```
git clone https://github.com/markondej/fm_transmitter
cd fm_transmitter
2015-08-07 04:39:55 +00:00
make
```
After successful build You can start transmitting by typing:
2015-07-22 15:38:41 +00:00
```
sudo ./fm_transmitter -f 102.0 acoustic_guitar_duet.wav
2015-07-22 15:38:41 +00:00
```
Where:
* -f <frequency> - Specifies the frequency in MHz, 100.0 by default if not passed
* acoustic_guitar_duet.wav - Sample WAVE file, You can use your own
2015-07-22 15:38:41 +00:00
Other options:
* -d <dma_channel> - Specifies the used DMA channel (0 by default), pass 255 in order to disable DMA and use CPU
* -r - Loops the playback
2018-12-29 02:31:10 +00:00
### Supported audio formats
You can transmitt uncompressed WAVE (.wav) files directly or read audio data from stdin, eg.:
2015-07-22 15:38:41 +00:00
```
sox star_wars.wav -r 22050 -c 1 -b 16 -t wav - | sudo ./fm_transmitter -f 100.6 -
```
2018-12-29 02:30:03 +00:00
Please note 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 support
In order to use a USB microphone input use arecord command, eg.:
```
arecord -D hw:1,0 -c1 -d 0 -r 22050 -f S16_LE | sudo ./fm_transmitter -f 100.6 -
2015-07-22 15:38:41 +00:00
```
In case of performance drop down use ```plughw:1,0``` instead of ```hw:1,0```.
2015-07-22 15:38:41 +00:00
2018-11-30 23:42:19 +00:00
## Legal note
2015-07-22 15:38:41 +00:00
Please keep in mind that transmitting on certain frequencies without special permissions may be illegal in your country.
## New features
* DMA engine support
* works on any Raspberry Pi model
2015-07-22 15:38:41 +00:00
* reads mono and stereo files
2015-07-30 09:13:57 +00:00
* reads data from stdin
Included sample audio was created by [graham_makes](https://freesound.org/people/graham_makes/sounds/449409/) and published on [freesound.org](https://freesound.org/)