[Openal] Everything is ok but .wav file wont play.
Chris Robinson
chris.kcat at gmail.com
Tue Mar 17 23:42:34 PDT 2009
On Tuesday 17 March 2009 5:20:51 pm Margin Marh wrote:
> When i checked the buffer it came as 0 and then i checked the
> alureGetErrorString and it told me its a unsupported type.
> But the strange thing is that i am using "Footsteps.wav" that comes with
> openal and it wont load it.
Unfortunately, "unsupported type" is currently a catch-all for saying a sound
can't be loaded, if a more-exact reason hasn't been set.
First, I'd double-check that the file you're trying to load actually exists.
Try to call:
FILE *f = fopen("Footsteps.wav", "rb");
and see if it returns non-NULL. If it returns NULL, the file doesn't exist.
IDEs tend to set an abnormal current working directory, so files wouldn't be
where you expect.
I intend to make ALURE be more descriptive of specific problems when opening
files. I just need to find a way to do so without giving false-positive
responses.
> Then i recorded my voice in windows sound recorder but it gave me the same
> result so is my code bad or is the file types really not supported?
With Windows sound recorder, you also need to make sure it's a regular PCM
wave (IIRC, it will try to save as an mp3-wave some times; at least it used to
for me).
> PS:How do i load other file types that isn't .wav
The same way. Just pass the filename to ALURE, and it will figure out how to
open it for you as long as the format is supported.
More information about the Openal
mailing list