# HG changeset patch # User Amine Sehili # Date 1546891930 -3600 # Node ID ccab869cdbcbaf9ffeb316b546b55429d2bd3748 # Parent da2330e5b9ce5f7590239541adf3deb567e7a52f Add function to save audio data as a raw file diff -r da2330e5b9ce -r ccab869cdbcb auditok/io.py --- a/auditok/io.py Mon Jan 07 20:51:58 2019 +0100 +++ b/auditok/io.py Mon Jan 07 21:12:10 2019 +0100 @@ -468,6 +468,14 @@ start += chunk_size +def _save_raw(filename, data): + """ + Save audio data as a headerless (i.e. raw) file. + """ + with open(filename, "wb") as fp: + fp.write(data) + + def _save_wave(filename, data, sampling_rate, sample_width, channels): """ Save audio data to a wave file.