Re: odd soundfile buffer problem
Re: odd soundfile buffer problem
- Subject: Re: odd soundfile buffer problem
- From: Eric Allamanche <email@hidden>
- Date: Fri, 21 May 2010 09:15:02 -0700
On May 20, 2010, at 10:00 PM, Brad Garton wrote:
> Hey Coreaudioers --
>
> I'm having a strange iPhoneOS problem, I'll post it here to see if anyone has any clues. I load a soundfile into a buffer:
>
> status = AudioFileReadPackets (soundFile, false, &numBytes, NULL, 0, &numPackets, sampBuf);
> if (status !=0) {
> NSLog(@"problem reading file packets into buffer");
> return -1;
> }
>
> and in the simulator it works fine and dandy to access and play the buffer. However, when I compile and load into my iPhone device, I hear nothing... no errors reported though.
>
> Now, if I add this line after the above code:
>
> NSLog(@"numPackets read into sampBuf: %d", numPackets);
>
> it then works fine on my device! Nothing else is changed in the code. Is this at all familiar to anyone?
when adding printf like statements make things work magically, then this hints at some heap/stack corruption issues. Have you checked that your buffers are large enough? Try enabling Guard Malloc and see what happens.
Eric
>
> brad
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Coreaudio-api mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden