[erlang-questions] Reading and Writing .wav files

Ivan Uemlianin ivan@REDACTED
Mon May 31 14:11:01 CEST 2010


Dear Max

Thank you for your comment.

Max Lapshin wrote:
> So, if file is 400 MB size, it will return 400MB binary?
>
> Much more convenient is such protocol:
>
> wave:pread(File, Offset) -> {ok, header, Header} | {ok, frame, Frame} | eof
>
> Maybe so?
>   

I suppose it depends on the use cases one has in mind.  I'll be working 
with small files --- less than 1MB --- and I'll want to process the 
whole file, so reading it all in in a oner seemed sensible.

wave:pread(File, 0) would just parse and return the header?  That sounds 
handy.

I can't see the use of looking at a single frame; but something like 
wave:pread(File, Offset, NFrames) could be useful, to read large files 
in bite-sized chunks.

I'll put these down as feature requests :)

Best wishes

Ivan

-- 
============================================================
Ivan A. Uemlianin
Speech Technology Research and Development

                    ivan@REDACTED
                     www.llaisdy.com
                         llaisdy.wordpress.com
                     www.linkedin.com/in/ivanuemlianin

    "Froh, froh! Wie seine Sonnen, seine Sonnen fliegen"
                     (Schiller, Beethoven)
============================================================



More information about the erlang-questions mailing list