Error "could not be opened: File contains data in an unknown format" when trying to play external wav file

After reading a bit HERE, I have tried to p[lay a wav audio file like so:

sample "C:/Users/Joni2/Pink_P.wav"

However, got this error:
File ‘C:/Users/Joni2/Pink_P.wav’ could not be opened: File contains data in an unknown format.

Why am I getting this error and how can I play in sonic pi the file I want?

The first thing to do is to identify the file format.

Try this page: File Identifier - Identify unknown files instantly

You should see something like “RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz” if it is a real wav audio file

1 Like

Thanks!! Really useful thing.
Found out that just changing the extension won’t work :sweat_smile:
(For future users - sometimes it might help to restart sonic pi after getting this error and changing the path)