ecomontec / ecoSound-web

Web application for ecoacoustics to manage, navigate, visualise, annotate, and analyse soundscape recordings.
https://ecosound-web.de/
GNU General Public License v3.0
19 stars 3 forks source link

FLAC for storage #389

Open kdarras opened 9 months ago

kdarras commented 9 months ago

Whenever WAV files are inserted into collections, we should compress them to FLAC (open-source lossless audio format) to save storage. Compression needs to happen on the client side before upload to avoid inefficient bandwidth usage (#375 ).

All the original meta-data of each single recording should be transferred to the new FLAC-encoded files (#424 ).

All the already-stored WAV files should be encoded to FLAC. This is a risky operation because we need to retain the original meta-data: a backup must be made beforehand. The penalty arising from the additional decoding step of temporary WAV files is negligible according to @zdroyer . Ultimately, we should not store WAV files anymore, and every time we need them for playback or analysis, temporary files would be generated.

zdroyer commented 3 months ago

The compression to FLAC can be implemented in the web browser using libflac.js ( https://github.com/mmig/libflac.js ). The original wave file metadata - either standard test RIFF-comment from Audiomoth or GUANO json formatted metadata (Wildlife Acoustics recorders) should be copied to the compressed file from the original WAV headers. Additionally, down-sampling can be applied during this process (see: https://github.com/mmig/libflac.js/blob/master/example/encode-func.js )