Jump to content
  • Advertisement
Sign in to follow this  
Unreal

OpenAL Porblem With Big WAV files.

This topic is 4868 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello people! I have a strange problem when i try to load WAV files using alutLoadWAVFile(...) If the file is big. (20MB for example) When play it using alSourcePlay(Source); i hear nothing.if i put a smaller file then it works! I took an other ready openal demonstration program from a tutorial and i replace the wav files of the tutorial program with my big wav file and i had the same problem (is this mean that i dont do something wrong?) maybe this is a alutLoadWAVFile(...) bug? or Drivers bug? The funny part is that in the past i didnt had this problem. but i dont remember hoow i was loading the wav file then. any idea what is going on? thank you

Share this post


Link to post
Share on other sites
Advertisement
Hmmm, if you're loading the whole file into memory... then maybe it's to big it fit completely? If you have decent PC with RAM > 256 than it's unlikely, probably OS would page it to disk, but there are also other things going on:

- memory fragmentation (but AFAIK it only affects speed of memory allocation, not whether it will succeed)
- other applications running in background may also eat some memory
- what is your program doing apart from loading that 20 MB file - ie., when you're loading other big sound files, 3d models, textures etc. you could run into such problem

Also, does those functions alutLoadWAVFile and alSourcePlay return any "success" values, ie. false when error occured? Have you tried checking that value?

Share this post


Link to post
Share on other sites
i dont think that is a memory error cause i have 1GB RAM and i have no other programs loaded.
The alSourcePlay() has void for return value.
The alutLoadWAVFile() in some pdfs say that it returns boolean value and in some others void value. my openal version return void cause i get "error convertion from void to boolean" when i compile it while i am trying to check if it returns true.
i dont know what is going on.. :(

Share this post


Link to post
Share on other sites
aahhh here is the demo:
http://www.devmaster.net/articles/openal-tutorials/lesson5.php
try to replace one of its file with a file about 30MB and tell me what is happening on you. thanks

Share this post


Link to post
Share on other sites
It could have something to do with ALut's wave reading functions (ALut is deprecated after all). Beyond that, I don't see any problems with that code. You could always try replacing the wave reading code with your own. You can usually find some simple wave reading code (by using Google) that doesn't handle unnecessary riff chunks, or you can have a look at the riff formats and make your own (which shouldn't take you too long, since you only need to know the basic structure of riff files to know how to discard chunks you don't need).

Share this post


Link to post
Share on other sites
I check this programm with big wav files with various sound cards..
the results... nforce2 audio and nforce4 audio fails to play the sound if the file is big. BUT Creative Audigy 1 , Creative Audigy 2NX play big wav files. I think something is wrong with the nvidia drivers. can someone with nforce2 or nforce4 audio play a big wav file with this program? (or using openal with alutLoadWAVFile())

thanks

Share this post


Link to post
Share on other sites
aahhh. i also try the demos from Creative OpenAL SDK. If the wav file is too big it does not play! I am 99% sure that is a drivers problem and not a problem with the devmaster code or my code or Creative OAL SDK code.

Share this post


Link to post
Share on other sites
To check for errors you use alGetError() - if it returns AL_NO_ERROR your ok, if it doesn't then to get a string representation of the error use alGetString(alGetError()). Try calling directly after alSourcePlay() to see what it gives, if the sound isn't being played then you must have some sort of error occurring.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!