Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - tcpie

Pages: [1]
1
Well, at least it works with the minimal code example you gave, so that's good news.

I noticed when I run the program without having the file present I get the error of "(format not supported)". So I think the problem is somehow I have working directory set to a wrong value when I run my application, resulting in it not being able to find the file.

The error message is a bit confusing in this regard, instead of saying "format not supported" it should say "file not found".

Anyways, I'll have look to see if I can get it to work in my project...

EDIT:
When I edit the working directory, it loads fine! It still doesn't play, but that's probably due to some unknown bug in my code.

2
I reckoned you meant the audio files? I attached them to this post.

3
I started out with a .wav file, and I export this to various file formats using Audacity.

But the original .wav should be fine as well; it plays fine. I also get the error for that file.

4
Hi all,

I'm trying to load an audio file and play it, but whatever I try, I keep getting the error

"Failed to open sound file "FOO.wav" (format not supported)"

So far I have tried the .flac, .wav, .ogg file formats, but none of them work! I am sure my sound file itself is fine (I can play it back with windows media player.) I also tried it out with other sound files, they all fail...

My code is:
 
sf::SoundBuffer buf;
std::cerr << "Load from buffer returns: " <<  buf.loadFromFile("gunshot02.wav") << std::endl;
 

This always returns 0. The sound file is in the same directory as the executable.

I am using SFML 2.3.0. My compile-toolchain is msys2, MinGW64. My linker list is:
-lsfml-system -lsfml-main -lsfml-graphics -lsfml-window -lsfml-audio -lopengl32 -lglu32 -lopenal32 -lflac -lvorbisenc -lvorbisfile -lvorbis -logg

My platform is Windows 7, 64 bit.

Pages: [1]