Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
SAudioStreamFormat getsampledata returns 0

drvds
Registered User
Quote
2013-11-09 21:39:20

Hello,

I am writing a programm in which I can make recordings with irrklang, save them on the disk and then later join those wav recordings together into a "giant" wav.

I have come across a strange problem that might have something to do with the wav length / file size and the function getsampledata() from SAudioStreamFormat.

After joining together the first couple of wav files [my output file has a length of 27 seconds by that point] the function getsampledata() returns a zero even due, getSampleDataSize() and all the other functions of this method return valid data.

Please have a look at the picture it will probably become more clear what I am talking about.

🔎︎



Also note that I use ESM_NO_STREAMING to open the file.

Can anyone guess why this function returns suddenly zero even due it works perfectly fine for the first couple of times?


drvds
Registered User
Quote
2013-11-09 22:25:22

by the way adding
	ISoundSource* firstwav = engine->addSoundSourceFromFile(bigwav.c_str(),ESM_NO_STREAMING,true);
firstwav->setForcedStreamingThreshold(-1);


doesn't change anything. why can one only set the streaming threashould after loading the file ?? ... doesn't that defeat the whole point ?


drvds
Registered User
Quote
2013-11-11 12:56:00

Ok I don't know what else to try. I now 'ported' my code, to a console application - just added it into the Hello World example.

again doing the usual:


ISoundSource* firstwav = engine->addSoundSourceFromFile("../../media/bu.wav",ESM_NO_STREAMING,true);
firstwav->setForcedStreamingThreshold(-1);


and even due I specify no streaming and set the threshold to -1, the console output is:

No streaming was specified, but forcing to play sound streamed (See ISoundSource
::setForcedStreamingThreshold): ../../media/bu.wav
Can read out the first file

where as bu is a 2.28MB wav file.

How do I solve this?


drvds
Registered User
Quote
2013-11-11 13:06:51

*WUHU* by doing exactly the opposite of this guy -> http://www.ambiera.com/forum.php?t=1676

i.e. setting the last parameter of addsoundsourcefromfile to FALSE


ISoundSource* firstwav = engine->addSoundSourceFromFile(bigwav.c_str(),ESM_NO_STREAMING,false);
firstwav->setForcedStreamingThreshold(0);

I solved it. This parameters are really confusing, maybe some should add this to the API documentation that they apparently cancel eachother out + I want the 6 hours of my life back ^^


niko
Moderator
Quote
2013-11-13 13:44:52

Ah, nice :)


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internati?nal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact