Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I'm getting the ISoundSource of some audio sources in my application like this: irrklang::ISoundSource* soundSource = irrKlangEngine->getSoundSource(fullsoundName.c_str(), true); After that is done (and I checked if soundSource isn't NULL) I try to get the sample data like this, together with some other information: short* data = (short*)soundSource->getSampleData(); Now, sometimes data seems to be NULL for some reason. I'm sure that the source I get this from are not streamed and that seemed to be the only exception when getSampleData() would return NULL. Am I forgetting something? Or is there something I should check? EDIT: I've did some more tests and I found that if the data wasn't preloaded it seems to be a problem. |
||||
|
Also note this from the documentation: This function will only return a pointer to the data if the audio file is not streamed, namely ESM_NO_STREAMING
|
||||
|
I'm pretty sure that the audio isn't in streaming mode. When I output the getStreamMode() value it returns ESM_AUTO_DETECT. Do you still think I might be doing something wrong when I register the sound so that it is in streaming mode? EDIT: Oh shit. I got it. I had to explicitly tell the ISoundSource object how to manage the file I added this and now it works: soundSource->setStreamMode(irrklang::ESM_NO_STREAMING); |
||||
|
Ah, nice that it's working now. :) |
|