0

I try to reproduce the given example obspy example in order to read a wav, unfortunately even with the same code as written in the example, I raise an error:

the wav exemple file can be downloaded from here: download 3cssan.near.8.1.RNON.wav

from obspy import read
read("3cssan.near.8.1.RNON.wav")
[...]
TypeError: Unknown format for file 3cssan.near.8.1.RNON.wav

I would be very grateful if you have any suggestion to fix this problem I would like to use obspy because I would like to continue my analysis with using a code implemented with obspy

Best regards

Xavier

mtrw
  • 34,200
  • 7
  • 63
  • 71
Xavier
  • 61
  • 1
  • 2

2 Answers2

0

On my system, the both WAV files that are available on the Obspy's website, are possible to be read without any problems.

In your case, I would suggest to define format you want to read in the read method:

from obspy import read
read("3cssan.near.8.1.RNON.wav", format="wav")

If this still won't work, I suggest redownloading the test file as it might be corrupted.

heavelock
  • 364
  • 4
  • 9
0
from obspy import read 
st = read("/path/to/3cssan.near.8.1.RNON.wav", format="wav")
print(st) 
st.plot();

hope this could help you https://docs.obspy.org/archive/1.2.0/packages/obspy.io.wav.html

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Pragnath
  • 1
  • 1