changeset 288:41a93cc1ced9

Handle the case where no output format could be guessed in StreamSaverWorker
author Amine Sehili <amine.sehili@gmail.com>
date Fri, 04 Oct 2019 22:02:37 +0100
parents d13ce50446b7
children 69ca1c64a9b0
files auditok/workers.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/auditok/workers.py	Fri Oct 04 21:48:01 2019 +0100
+++ b/auditok/workers.py	Fri Oct 04 22:02:37 2019 +0100
@@ -177,6 +177,8 @@
         self._cache_size = cache_size_sec * self._reader.sr * sample_size_bytes
         self._output_filename = filename
         self._export_format = _guess_audio_format(export_format, filename)
+        if self._export_format is None:
+            self._export_format = "wav"
         self._init_output_stream()
         self._exported = False
         self._cache = []
@@ -273,7 +275,6 @@
                 self._export_raw()
             self._exported = True
             return self._output_filename
-
         try:
             self._export_with_ffmpeg_or_avconv()
         except AudioEncodingError: