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 header is fully inconsistent before seek fix #120

Open
ilyapashuk opened this issue May 2, 2021 · 0 comments
Open

wav file header is fully inconsistent before seek fix #120

ilyapashuk opened this issue May 2, 2021 · 0 comments

Comments

@ilyapashuk
Copy link
Contributor

wav.Encode function tries to write all samples and then seek to the beginning of file and set correct duration in the header.

but it is not fully usefull in cases when it is used for streaming, for example wav.Encode(os.Stdout, streamer, format)

sox tool also do something like that, but if seeking is not possible, their header remains consistent, and if we make something like this:
rec -t wav - | play -t wav -
2 copies of sox will perfectly understand each other, "unknown" will be in the duration field.

with your function header is fully inconsistent.

please patch the main Encode function or add an other function that don't try to do anything with length in the header, may be simply keep it 0, and expect io.Writer instead WriteSeeker.

MarkKremer pushed a commit to MarkKremer/beep that referenced this issue Apr 6, 2024
Assert the resampler ratio is a valid number
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

1 participant