fix: path and log

This commit is contained in:
Félix Voituret
2019-11-06 18:36:34 +01:00
parent af7e3253fc
commit deaadf06a3
2 changed files with 3 additions and 0 deletions

View File

@@ -82,6 +82,7 @@ class AudioAdapter(ABC):
duration.numpy(),
sample_rate.numpy(),
dtype=dtype.numpy())
get_logger().info('Audio data loaded successfully')
return (data, False)
except Exception as e:
get_logger().warning(e)

View File

@@ -55,6 +55,8 @@ class FFMPEGProcessAudioAdapter(AudioAdapter):
:param dtype: (Optional) Numpy data type to use, default to float32.
:returns: Loaded data a (waveform, sample_rate) tuple.
"""
if not isinstance(path, str):
path = path.decode()
probe = ffmpeg.probe(path)
if 'streams' not in probe or len(probe['streams']) == 0:
raise IOError('No stream was found with ffprobe')