Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.wav file, produced by sBitx REC button, is invalid. #16

Open
wb2osz opened this issue Sep 29, 2022 · 1 comment
Open

.wav file, produced by sBitx REC button, is invalid. #16

wb2osz opened this issue Sep 29, 2022 · 1 comment

Comments

@wb2osz
Copy link

wb2osz commented Sep 29, 2022



The .wav file produced by the sBitx REC button can't be read by other applications.
One application reported that the data length was -1 which would not be possible.
Let's take a look at it in detail.


$ od -t x1   sbitx/audio/20220929-0138-12.wav  | more

0000000 52 49 46 46 23 00 00 00 57 41 56 45 66 6d 74 20
        ----------- ----------- ----------- -----------
First 4 bytes "RIFF" - OK.
Next 4 bytes should be file length - 8.  
(remaining length of file after these first 8 bytes.)
Instead we find 19 which is not puzzling.  <--- *** ERROR ***
Next "WAVE" - OK
Next "fmt " - OK


0000020 10 00 00 00 01 00 01 00 e0 2e 00 00 c0 5d 00 00
        ----------- ----- ----- ----------- -----------
4 bytes for the format 16 - OK
2 bytes.  1=PCM. - OK
2 bytes.  1 channel (mono). - OK
4 bytes - 12000 samples per second - I was expecting 96000
4 bytes - 24000  block align * samples per second.

0000040 02 00 10 00 64 61 74 61 ff ff ff ff 81 fe c4 fe
        ----- ----- ----------- -----------.
2 bytes.  2 = block align - bits per sample / 8 * number of channels - OK
2 bytes. 16 bits per sample. - OK
4 bytes. "data" - OK
4 bytes.  Should be number of bytes following.
Instead we find -1.     <---  *** ERROR ***

0000060 44 fe 25 ff 9b 00 1b 01 f3 00 1c 01 35 01 6b 00



The problem is that the two length fields are not filled in.
When recording is finished, the application must seek to:
 * offset 4 from beginning and fill in file length - 8.
 * offset 40 from beginning and fill in file length - 44.

@afarhan
Copy link
Owner

afarhan commented Sep 29, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants