changeset 105:471d87445d09

Save compressed audio formats with pydub
author Amine Sehili <amine.sehili@gmail.com>
date Sat, 12 Jan 2019 16:32:21 +0100
parents 4dcbc6ae39c7
children 9505b35ef8ea
files auditok/io.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/auditok/io.py	Sat Jan 12 16:19:47 2019 +0100
+++ b/auditok/io.py	Sat Jan 12 16:32:21 2019 +0100
@@ -668,6 +668,9 @@
         raise AudioParameterError(err_message)
     if audio_format in ("wav", "wave"):
         _save_wave(file, data, sampling_rate, sample_width, channels)
+    elif _WITH_PYDUB:
+        _save_with_pydub(file, data, audio_format, sampling_rate,
+                         sample_width, channels)
     else:
         err_message = "cannot write file format {} (file name: {})"
         raise AudioIOError(err_message.format(audio_format, file))
\ No newline at end of file