On 6/29/10, Development <developm...@fornextsoft.com> wrote:
> Can open al not read ogg files? I'm attempting to load a short ogg clip and
> I keep getting random errors.
>
> getOpenALAudioData: ExtAudioFileOpenURL FAILED, Error = 1954115647
> 2010-06-29 15:13:53.965 MixPad[12402:207] error attaching audio to buffer:
> a003
>
>
>
> this is the file loading code, it is directly from an apple example
>
>       ALenum  error = AL_NO_ERROR;
>       ALenum  format;
>       ALsizei size;
>       ALsizei freq;
>       
>       //NSBundle*                             bundle = [NSBundle mainBundle];
>       
>       // get some audio data from a wave file
>       CFURLRef fileURL = (CFURLRef)[[NSURL fileURLWithPath:self.path] retain];
>       
>       if (fileURL)
>       {       
>               data = getOpenALAudioData(fileURL, &size, &format, &freq);
>               CFRelease(fileURL);
>               
>               if((error = alGetError()) != AL_NO_ERROR) {
>                       NSLog(@"error loading sound: %x\n", error);
>                       exit(1);
>               }
>               
>               // use the static buffer data API
>               alBufferDataStaticProc(self.alBufferID, format, data, size, 
> freq);
>               
>               NSLog(@"Format %i",format);
>               NSLog(@"Data %i",sizeof(data));
>               
>               if((error = alGetError()) != AL_NO_ERROR) {
>                       NSLog(@"error attaching audio to buffer: %x\n", error);
>               }               
>       }
>       else
>               NSLog(@"Could not find
> file!\n");_______________________________________________
>

OpenAL is format agnostic. It doesn't know anything about file types.
It only accepts bytes of linear PCM.

Apple / Core Audio don't natively support Ogg.

Generally, if you want to use Ogg, you have to compile in the Ogg
Vorbis libraries from Xiph and use their APIs. ov_read() would be good
place to start looking.

-Eric
http://playcontrol.net/iphonegamebook
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to