왜 scipy.io.wavfile.read가 튜플을 반환하지 않습니까?
문제
Scipy를 사용하여 *.wav 파일을 읽으려고합니다. 다음을 수행합니다.
import scipy
x = scipy.io.wavfile.read('/usr/share/sounds/purple/receive.wav')
이 코드의 결과로 다음과 같습니다.
Traceback (most recent call last):
File "test3.py", line 2, in <module>
x = scipy.io.wavfile.read('/usr/share/sounds/purple/receive.wav')
AttributeError: 'module' object has no attribute 'io'
여기서 무엇이 잘못되었는지 아는 사람이 있습니까? 미리 감사드립니다.
해결책
오류에서 알 수 있듯이 Scipy 모듈에는 'IO'가 없습니다.
io.wavfile
하위 모듈입니다 from scipy.io import wavfile
그리고 그렇게합니다 wavfile.read("/usr/share/sounds/purple/receive.wav")
그러나 예제로 사용하는 파일에 오류가 발생합니다.
제휴하지 않습니다 StackOverflow