Chunked file reading

21 views
Skip to first unread message

matthia...@gmail.com

unread,
Nov 14, 2017, 4:05:07 PM11/14/17
to madmom-users
Hi all

Is there a possibility to process an audio file (wav) in chunks? I want to process a large file (about 3GB).
I only found the Stream class, which reads from an input device? 

If there isn't an implementation of chunked wav reading, would it be reasonable to create a WavFileStream class, which basically does the same thing as Stream but from a wav file?

Regards
Matthias

sebastian.bo...@gmail.com

unread,
Nov 16, 2017, 2:02:29 AM11/16/17
to madmom-users
Hi,

unfortunately, there's no way to do this yet. However, the basic infrastructure is there, so it shouldn't be too much work to achieve that functionality. There's a issue on GitHub (https://github.com/CPJKU/madmom/issues/250) which deals exactly with this.

So far madmom can process audio files either as a whole or frame-by-frame. The general idea was to have a `block_size` parameter for the `process()` method of any processor, which then loads enough data and processes the whole signal in blocks of the given size. `load_wav_file` already supports mem-mapping of wav files, i.e. even if you load a very large file only the parts needed are mapped into memory. So the only thing missing is to tell classes other than `Signal` and `FramedSignal` to process stuff in blocks/chunks.

Please feel free to post any further thoughts/questions to the GitHub issue -- or even start working on it :)


HTH
Reply all
Reply to author
Forward
0 new messages