'UnboundLocalError: local variable 'data' referenced before assignment in wavfileread

I used scipy.io's wavfile to read the wav file which has 3 channels.

from scipy.io import wavfile
samplerate,data_origin = wavfile.read('file1.wav')

However I received UnboundLocalError: local variable 'data' referenced before assignment

May I know how can I solve this issue? Is it related to the audio file issue? Thank you.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source