Topics

How to create compatible raw audio files?


James Dallas
 

Hi everyone,

From reading the documentation, audio files need to be:

* raw
* 16-bit little endian (not sure if signed or unsigned? ffmpeg has both s16le and u16le).
* 48 kHz sampling
* monoI

IIRC Eduoard was asked once to support other formats but said no, probably because this is a relatively minor feature.

I imagine that ffmpeg can probably be used to generate such files from WAV, MP3, etc, but not quite sure of the exact ffmpeg command to make that work.

Does anyone have any experience with this? If so, please share (cannot find in the documentation).

Thanks and 73s,

AD5NL


Edouard Griffiths
 

Hello,

audio files to do what? For the modulators? Anyway sox is a great tool to convert audio files: http://sox.sourceforge.net/
It has been there for a very long time so it is very stable and has packages in almost all distributions.

Best regards,
Edouard.


James Dallas
 

Yes, for modulator testing.

I will try sox. Thanks for the suggestion.

On Sat, Jan 19, 2019 at 9:39 AM Edouard Griffiths <f4exb06@...> wrote:
Hello,

audio files to do what? For the modulators? Anyway sox is a great tool to convert audio files: http://sox.sourceforge.net/
It has been there for a very long time so it is very stable and has packages in almost all distributions.

Best regards,
Edouard.


James Dallas
 

Hi Eduoard,

After a lot of fooling around I finally got this working with sox.

The command that worked was

sox piano.wav -t raw -r 48k -c 1 -b 32 -L -e float piano.raw

The commands I've tried that failed were:

sox piano.wav -t raw -r 48k -c 1 -b 16 -L piano.raw
sox piano.wav -t raw -r 48k -c 1 -b 32 -L piano.raw
sox piano.wav -t raw -r 48k -c 1 -b 16 -L -e signed-integer piano.raw

This was confusing in part because the documentation online does not match the tooltip (the tooltip in 4.4.0 / 4.4.1 is accurate as to format):

Example (16-bit): https://github.com/f4exb/sdrangel/tree/master/plugins/channeltx/modwfm (says must be 16LE 48k mono raw)

Example (32-bit tooltip, image attached).

image.png

I'd suggest the documentation may need to be updated.

Also, I note that once you start playing back a recorded file, the modulator can't really do anything else. For example, try playing a file and then turning the tone or morse code sender on. Doesn't seem to work for me.

In my experience, the better way to play back recorded audio in Linux is to use Pulse to pipe in the audio into sdrangel using Audio In. For example, start microphone input, then go to Pulse  Volume Control GUI, go to Recording tab, and change over to "Monitor of Built-In Speaakers" instead of "Microphone." Then start playing back your audio. I was able to stream the audio from some music videos on youtube into the WFM modulator that way, had myself a little ultra-low-power pirate radio station this weekend (the powerful riffs of Weezer made it all the way to the kitchen in my modest little home).

On Sat, Jan 19, 2019 at 9:46 AM James Dallas via Groups.Io <jim.dallas=gmail.com@groups.io> wrote:
Yes, for modulator testing.

I will try sox. Thanks for the suggestion.

On Sat, Jan 19, 2019 at 9:39 AM Edouard Griffiths <f4exb06@...> wrote:
Hello,

audio files to do what? For the modulators? Anyway sox is a great tool to convert audio files: http://sox.sourceforge.net/
It has been there for a very long time so it is very stable and has packages in almost all distributions.

Best regards,
Edouard.


Edouard Griffiths
 

Checked the code and indeed all modulators take F32LE input. It is mono except for the SSB modulator in binaural mode that takes 2 channels.
It is normal that you cannot send a tone mixed with the input from file because it is designed like this. The GUI should prevent it (not sure it does).


James Dallas
 

Just to be clear what I mean is that after the file finishes playing, it sort of appears to freeze the demodulator; you have to close and reopen it to do other stuff. 

This may mean the same thing as what you are saying if there isn't an "end" to file playing. 

On Tue, Jan 22, 2019, 5:01 AM Edouard Griffiths <f4exb06@... wrote:
Checked the code and indeed all modulators take F32LE input. It is mono except for the SSB modulator in binaural mode that takes 2 channels.
It is normal that you cannot send a tone mixed with the input from file because it is designed like this. The GUI should prevent it (not sure it does).


Edouard Griffiths
 

At the end of the file if not in loop mode the "play/stop" button is not updated automatically. You have to press it to actually stop the file input mode and release the other input modes.


James Dallas
 

Ahh ok thanks


On Tue, Jan 22, 2019, 6:28 AM Edouard Griffiths <f4exb06@... wrote:
At the end of the file if not in loop mode the "play/stop" button is not updated automatically. You have to press it to actually stop the file input mode and release the other input modes.