0

when I try the following program :

import wave  
w = wave.open('f.wav', 'r')  
for i in range():  
    frame = w.readframes(i)  

the following error comes :

Traceback (most recent call last):  
  File "F:/Python31/fg.py", line 2, in <module>  
    w = wave.open('f.wav', 'r')  
  File "F:\Python31\lib\wave.py", line 498, in open  
    return Wave_read(f)  
  File "F:\Python31\lib\wave.py", line 159, in __init__  
    f = builtins.open(f, 'rb')  
IOError: [Errno 2] No such file or directory: 'f.wav'  

can u tell me wat could b the reason ???

0

2 Answers 2

2

The file is not in the path you put that Python interpreter can find. Check that f.wav is in the same path of your script (or chance the path in open). Is not a wave issue at all.

Sign up to request clarification or add additional context in comments.

Comments

1

You are running the python script from a directory where no file f.wav exists. It can't find the file to read. Either copy f.wav to that directory or run you script from the directory f.wav is located in.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.