ggerganov / ggwave

Tiny data-over-sound library
https://youtu.be/Zcgf77T71QM
MIT License
1.9k stars 141 forks source link

ggwave-from-file with empty results on non-48kHz files #107

Open PhForty opened 5 months ago

PhForty commented 5 months ago

When using the ggwave-to-file binary, there is a flag for changing the sample rate of the output, -s. I would expect the corresponding ggwave-from-file binary to be able to work with the new sample rate. It does not though and produces empty results. It appears from my superficial testing that ggwave-from-file only supports file sampled with 48kHz. I don't understand why, because for example the file generated below contains only frequencies of below 10 kHz and no information is missing in the audio file itself, when its sampled at a lower rate.

What I did:

./ggwave-to-file -s44100 -fout.wav -> then typed "abc" -/ggwave-from-file out.wav The output looks like this:

Usage: ./ggwave-from-file audio.wav [-lN] [-d]
    -lN - fixed payload length of size N, N in [1, 64]
    -d  - use Direct Sequence Spread (DSS)

[+] Number of channels: 1
[+] Sample rate: 44100
[+] Bits per sample: 16
[+] Total samples: 47041
[+] Decoding .. 

[+] Done