On Fri, 14 Dec 2007, Soenke Hahn wrote:

> > ... the one thing I would most like to
> > see is a lazy version, enabling something like this:
> > do
> >  hFile <- openFile "path/filename" ReadMode
> >  hOutFile <- openFile "path/newFile" WriteMode
> >  (format, audioData) <- HSnd.readFile hFile
> >  HSnd.writeFile hOutFile format $ some_processing_func audioData
> >  closeFile hFile
> >  closeFile hOutFile
>
> I thought about that once too (i used libst, the library behind sox). As i see
> it, one problem is, that the headers of audio files (at least the ones, i
> looked at) include the length of the soundfile. If 'some_processing_func'
> changes the length of the sound data, you would have to modify the header
> after writing the whole file. Is this supposed to happen in the 'closeFile'
> operation?

Indeed, the iffparse.library on AmigaOS did it this way. This is obviously
only possible on devices that allow for 'seek'.
_______________________________________________
haskell-art mailing list
[email protected]
http://lists.lurk.org/mailman/listinfo/haskell-art

Reply via email to