-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add some support for reading from pipe #80
Comments
Hmm, I wonder if you could base this solution on the existing ‘wavappend’ function. The goals seem similar. |
davidavdav
added a commit
to davidavdav/WAV.jl
that referenced
this issue
Nov 7, 2019
davidavdav
added a commit
to davidavdav/WAV.jl
that referenced
this issue
Nov 7, 2019
3 tasks
closing this issue for now, as the accompanying PR (#81) is closed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I think it is great there is WAV file reading support in Julia.
For my current application I need to process audio data that is dynamically modified on the unix pipeline. Typically the modification happens with
sox
, and I want to add modifications (or read the pipeline) with Julia.With a little trick you can read from an
IO
buffer that basically is a`cmd`
or even from a
pipeline(`cmd1`, `cmd2`)
with an additionalassuming we won't actually want to skip data on the pipeline.
However, when the cmd can't predict the wav length and can't seek back to fix it (as you can't on a unix pipeline), tricking
readwav
this way fails because it is trying to consume more data than available. E.g., with acmd=`sox -t wav - -t wav - speed 1.1`
Sox actually warns about the trouble with the header being wrong, but still, since this is a still a common pattern in, e.g, Kaldi, it would be nice if
wavread
could be modified in a way that it can read from a pipeline, and fix the length afterwards.I currently add a
"sox -t wav - -t raw -r16000 -"
on the pipeline I am reading from and then usereinterpret(Int16, read(pipeline([`$p` for p in pipe]...))) / 32768
, effectively not usingWAV.jl
at all, which is a bit of a shame.So support for reading from a pipeline would be great!
The text was updated successfully, but these errors were encountered: