Hello, I would like to compress some data, stored in a Numpy Array (Python) with something like (*): flac.compress(my_array) without having to put data in a .wav file, without having to deal with containers, etc., i.e. : *raw data in / raw data out* Do you have an idea on how to do that with FLAC? This could be useful for audio data of course (stored in simple arrays), but also for other kind of sampled data : I can imagine that FLAC can be useful on lots of different kinds of data (mainly for those whose waveforms look like continuous function, like audio data), isn't it true ? Best regards, basj (*) in a similar fashion than all Python tools like : json.dumps(mydata), lz4.dumps(mydata), pickle.dumps(myobject), -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/flac-dev/attachments/20140315/f76febf6/attachment.htm
Nouvelle Collection wrote:> I would like to compress some data, stored in a Numpy Array (Python) with > something like (*): > > flac.compress(my_array) > > without having to put data in a .wav file, without having to deal with > containers, etc., > i.e. : > *raw data in / raw data out* > > Do you have an idea on how to do that with FLAC?I am not aware of any FLAC Python bindings. However, libsndfile supports FLAC and there is a Python/Numpy binding here: https://github.com/bastibe/PySoundFile> This could be useful for audio data of course (stored in simple arrays), > but also for other kind of sampled data : I can imagine that FLAC can be > useful on lots of different kinds of data (mainly for those whose waveforms > look like continuous function, like audio data), isn't it true ?Yes, anything that is vaguely continuous sampled data can be stored in a FLAC file. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/