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

Unable to write multiple LIST chunks #55

Closed
rjkat opened this issue Apr 12, 2018 · 3 comments
Closed

Unable to write multiple LIST chunks #55

rjkat opened this issue Apr 12, 2018 · 3 comments
Assignees
Milestone

Comments

@rjkat
Copy link
Contributor

rjkat commented Apr 12, 2018

With the current API it's not possible to write multiple chunks of the same type. This is needed e.g. for writing a .wav file that contains both a LIST chunk for the INFO chunk and another one for the cue points.

I propose that wavwrite be updated as follows:

wavwrite(samples::AbstractArray, io::IO; Fs=8000, nbits=0, compression=0,
                  chunks::Vector{Tuple{Symbol, Array{UInt8,1}}}=Tuple{Symbol, Array{UInt8,1}}[])

This would allow multiple LIST chunks to be written, and also allow the order of chunks written to be specified (at the moment it depends on Julia's hashing) but it will be a breaking change to the API. We'll have to change wavread as well - we can make it return a Vector{Tuple{Symbol, Array{UInt8,1}} or a Dict{Symbol, Vector{Any}} where the entries in the dictionary are vectors containing all the chunks with a particular ID. I'd tend to go with the first option because it means you could read/write chunks without having to convert between the two types.

@dancasimiro if you approve of this change then I'm happy to implement and test it. If not, let me know your thoughts on other options.

rjkat added a commit to rjkat/WAV.jl that referenced this issue Apr 12, 2018
dancasimiro added a commit that referenced this issue Apr 19, 2018
Proposed fix for issue #55
@dancasimiro
Copy link
Owner

Fixed by pull request #56, but still waiting for documentation updates.

@dancasimiro dancasimiro added this to the v1.0.0 milestone Apr 19, 2018
@rjkat
Copy link
Contributor Author

rjkat commented Apr 20, 2018

Thanks Dan. I've updated the docs. Feel free to edit as you see fit 😄

@rjkat rjkat mentioned this issue Apr 20, 2018
@dancasimiro
Copy link
Owner

I am going to wait for other breaking changes before publishing v1.0.0 of the WAV library. I would also like to wait until the FileIO.jl package is updated to support the newest Julia.

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