Stdin read ready

pull/7/head
Marcin Kondej 2015-07-30 11:13:57 +02:00
rodzic c694485a9c
commit 3efe490c54
5 zmienionych plików z 13 dodań i 16 usunięć

Wyświetl plik

@ -13,17 +13,16 @@ Then you can use it by typing:
sudo ./fm_transmitter [filename] [frequency]
```
Like:
You can open WAVE files or read audio data from stdin, i.e.:
```
sudo ./fm_transmitter star_wars.wav 100.0
sox star_wars.wav -r 8000 -c 1 -b 8 -t wav - | sudo ./fm_transmitter - 100.0
```
You can open WAVE files.
Please keep in mind that transmitting on certain frequencies without special permissions may be illegal in your country.
## New features
* works both on RPi 1 and RPi 2
* reads mono and stereo files
* reads data from stdin
* based on threads

Wyświetl plik

@ -4,12 +4,12 @@
"transmitter.h"
<cstdlib>
1438126479 /home/pi/Projects/fm_transmitter/transmitter.h
1438126951 /home/pi/Projects/fm_transmitter/transmitter.h
"wave_reader.h"
"stdin_reader.h"
"error_reporter.h"
1437599898 source:/home/pi/Projects/fm_transmitter/transmitter.cpp
1438244712 source:/home/pi/Projects/fm_transmitter/transmitter.cpp
"transmitter.h"
<exception>
<sstream>
@ -256,13 +256,13 @@
<sstream>
<unistd.h>
1438122736 /home/pi/Projects/fm_transmitter/stdin_reader.h
1438246503 /home/pi/Projects/fm_transmitter/stdin_reader.h
<vector>
<fcntl.h>
"audio_format.h"
"error_reporter.h"
1438122736 source:/home/pi/Projects/fm_transmitter/stdin_reader.cpp
1438245689 source:/home/pi/Projects/fm_transmitter/stdin_reader.cpp
"stdin_reader.h"
<exception>
<sstream>

Wyświetl plik

@ -10,10 +10,10 @@
<File name="stdin_reader.cpp" open="1" top="0" tabpos="2">
<Cursor position="1771" topLine="33" />
</File>
<File name="stdin_reader.h" open="1" top="0" tabpos="3">
<Cursor position="1902" topLine="35" />
<File name="stdin_reader.h" open="1" top="1" tabpos="3">
<Cursor position="1902" topLine="31" />
</File>
<File name="transmitter.cpp" open="1" top="1" tabpos="4">
<File name="transmitter.cpp" open="1" top="0" tabpos="4">
<Cursor position="4471" topLine="23" />
</File>
<File name="transmitter.h" open="0" top="0" tabpos="3">

Wyświetl plik

@ -36,8 +36,6 @@
#include <sstream>
#include <unistd.h>
#include <iostream>
using std::exception;
using std::ostringstream;

Wyświetl plik

@ -39,9 +39,9 @@
#include "audio_format.h"
#include "error_reporter.h"
#define BUFFER_SIZE 128
#define SAMPLE_RATE 22050
#define BITS_PER_SAMPLE 16
#define BUFFER_SIZE 1024
#define SAMPLE_RATE 8000
#define BITS_PER_SAMPLE 8
#define CHANNELS 1
using std::vector;