From 2e2c2e60a57105573f083605773d3fd016beb61a Mon Sep 17 00:00:00 2001 From: Guihao Liang Date: Wed, 20 May 2020 17:01:41 -0700 Subject: [PATCH] Fix load_audio (#3207) --- .../turicreate/toolkits/audio_analysis/audio_analysis.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/python/turicreate/toolkits/audio_analysis/audio_analysis.py b/src/python/turicreate/toolkits/audio_analysis/audio_analysis.py index ea50cd88dc..c894c0f371 100644 --- a/src/python/turicreate/toolkits/audio_analysis/audio_analysis.py +++ b/src/python/turicreate/toolkits/audio_analysis/audio_analysis.py @@ -61,7 +61,8 @@ def load_audio( >>> audio_path = "~/Documents/myAudioFiles/" >>> audio_sframe = tc.audio_analysis.load_audio(audio_path, recursive=True) """ - _scipy = _minimal_package_import_check("scipy") + # import scipy does fake include + _wavfile = _minimal_package_import_check("scipy.io.wavfile") path = _tc.util._make_internal_url(path) @@ -85,7 +86,7 @@ def load_audio( ) for cur_file_path in all_wav_files: try: - sample_rate, data = _scipy.io.wavfile.read(cur_file_path) + sample_rate, data = _wavfile.read(cur_file_path) except Exception as e: error_string = "Could not read {}: {}".format(cur_file_path, e) if not ignore_failure: