Anthony96922/mpxgen

Other than sox

Closed this issue · 7 comments

Hi, Anthony! Can I use a program other than sox to extract the sound into mpxgen? Sox is not very good with online streams/

You can use ffmpeg for online streams. Example:

ffmpeg -loglevel 24 -i http://radio.kpskfm.com:8000/kpsk.aac -f wav - | ./mpxgen --audio - --mpx 10

Thank you, I will definitely try

Ffmpeg works much better! Tell me, is it possible to start mpxgen to choose a sound card, which will be fed mpx?

There is a way to have mpxgen use a different card. Run "cat /proc/asound/cards" to get a list of sound devices. Then create a ~/.libao configuration file with "dev=hw:(card number)" and mpxgen will output to that card.

anthony@odroid-c1:~$ cat /proc/asound/cards
 0 [ODROIDHDMI     ]: SOC-Audio - ODROID-HDMI
                      ODROID-HDMI
 1 [ODROIDDAC      ]: SOC-Audio - ODROID-DAC
                      ODROID-DAC
anthony@odroid-c1:~$ echo dev=hw:1 >> ~/.libao

Does the libao config work?

Hi, Anthony! I can't compile the project. An error appears in my Debian 8 system:

gcc -Wall -O2 -pedantic -c -o mpx_gen.o mpx_gen.c
In file included from mpx_gen.c:26:0:
rds.h:33:28: warning: C++ style comments are not allowed in ISO C90
#define BITS_PER_GROUP 104 // (GROUP_LENGTH * (BLOCK_SIZE+POLY_DEG))
^
rds.h:33:28: warning: (this will be reported only once per input file)
mpx_gen.c: In function ‘postprocess’:
mpx_gen.c:44:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (int i = 0; i < inbufsize; i++) {
^
mpx_gen.c:44:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
mpx_gen.c: In function ‘generate_mpx’:
mpx_gen.c:61:2: warning: C++ style comments are not allowed in ISO C90
// Gracefully stop the encoder on SIGINT or SIGTERM
^
mpx_gen.c:61:2: warning: (this will be reported only once per input file)
mpx_gen.c:63:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (int i = 0; i < 2; i++) {
^
mpx_gen.c:72:2: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
float mpx_data[DATA_SIZE];
^
mpx_gen.c:85:2: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
int ao_driver;
^
mpx_gen.c:104:2: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
int src_error;
^
mpx_gen.c:125:3: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
char *ptys[] = {"None", "News", "Information", "Sports",
^
mpx_gen.c:139:4: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for(int f = 1; f < af_array[0]+1; f++) {
^
mpx_gen.c: In function ‘main’:
mpx_gen.c:314:2: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
int errcode = generate_mpx(audio_file, output_file, rds, pi, ps, rt, alternative_freq, mpx, control_pipe, pty, tp);
^
<встроенное>: ошибка выполнения рецепта для цели «mpx_gen.o»
make: *** [mpx_gen.o] Ошибка 1

Latest commit should fix this.