Reputation: 103
I am coding in python and am trying get data from a .wav file so that I can perform a FFT and use that result to determine the freq of the note played.
This is what I have tried:
and this is the error I am getting:
Upvotes: 1
Views: 262
Reputation: 310993
Strings, such as the path to your file, need to be denoted by quotes ('
s) or double quotes ("
s):
harp = wav.open('/Users/williamwiess2/Desktop/Test 2/harp.wav', 'r');
# Here ---------^--------------------------------------------^
Upvotes: 0
Reputation: 28963
The syntax error is that /
is the math division operator (10/2, val1/val2) and needs numbers on either side, and opening a function call into a division with no numbers is a nonsense - invalid.
Your filename needs to be a string - enclosed in quotes.
harp = wave.open('/path/to/file', 'r')
(And it presumably needs to be wave.open
not wav.open
)
Upvotes: 1