M17-Project / m17-tools

A set of M17 tools
GNU General Public License v3.0
29 stars 3 forks source link

Make it slightly easier to use m17-mod for the first time #21

Closed roberttstephens closed 10 months ago

roberttstephens commented 10 months ago

It took me a little bit to figure out the input format of the modulator, look for a wav file matching those specs, give up, then record and convert my own wav file to test with.

I thought it might be a good idea to commit a little-endian, 16 bit, mono 8000 Hz wav file directly to the repo so people who are not as familiar with wav/sox can get started a little quicker. Let me know if you think a different approach (like adding instructions) would be better.

For reference, I used Pipewire (automatically installed on Arch Linux) to record and convert this file with the following commands.

# Record using pipewire, creates a RIFF (little-endian) data, 16 bit, stereo 48000 Hz wav file.
pw-record /tmp/recorded.wav
# Convert to 8000 hz, the input format of m17-mod.
sox /tmp/recorded.wav -r 8000 -b 16 -c 1 /tmp/8k.wav

I tested it with the following successfully. sox /tmp/8k.wav -t raw - | m17-mod -S AB1CD | m17-demod -l | play -q -b 16 -r 8000 -c1 -t s16 -

Also, small detail, but I think the -b should be changed to -x in the command below. I made that change in this PR.

sox brain.wav -t raw - | ./m17-mod -S AB1CD -b > m17.bin
roberttstephens commented 10 months ago

One other thing, I had to modify include/m17cxx/Util.h to have #include <cstdint> for it to compile. Should this be committed?

EDIT: It looks like including it is required for gcc 13 per https://gcc.gnu.org/gcc-13/porting_to.html. I'm on 13.2.1 .

sp5wwp commented 10 months ago

Can you check if the samples you require are available here? Good find with the -b and -x swap :) Thanks!