dancasimiro/WAV.jl

wavread(..., format = "native")

dmbates opened this issue · 5 comments

The README file indicates that one possible value for the wavread format argument is "native" but I don't see that value occurring anywhere in the code. There are checks for "double" and for "size" as values of format but it seems that any value other than those two is taken as "native".

I would like to use the package to load .wav files extracted from CDDA format. As WAV files these are simple 16-bit PCM encoding of 2 channels sampled at 41000 Hz. I just want the PCM samples to convert to FLAC. In the end, however, I avoided the package because it takes a very long time to return the native format. The read_pcm_samples function is very slow for returning the native format and I suspect that there is some unnecessary conversion taking place. In trying to see what happens when format = "native" I couldn't find that.

Is it expected that any format value other than "double" or "size" will be interpreted as "native"?

Yes, "double" and "size" trigger conversions. Otherwise, the function returns what is read from the file.

How big are the files?

I'm not familiar with CDDA. Is the WAV data embedded within? Does it just define extra block types?

CDDA is the definition of the audio format on audio CD's.

The audio contained in a CD-DA consists of two-channel signed 16-bit Linear PCM sampled at 44,100 Hz.

Programs like icedax read the audio files on a CD and write WAV.

What do you want to change in this issue? Are you trying to optimize the implementation? If so, do you have a goal in mind?

As I mentioned in #42, I just want to grab the data chunk from a CD track and that can be done by memory-mapping a .cda file. It is indeed a matter of optimization for me.