Receiving Strange Static When Trying to Render Vorbis Files
Receiving Strange Static When Trying to Render Vorbis Files
- Subject: Receiving Strange Static When Trying to Render Vorbis Files
- From: "Jonathan Kantrowitz" <email@hidden>
- Date: Wed, 9 Jan 2008 18:56:33 -0500
Hi there,
I currently have tried to implement Vorbis file playback in an application I am working on, but the audio is coming out laced with static 10 times louder then it should be. I am using audioqueue and libvorbis to playback ogg vorbis. Below is my render method. I have tried to pinpoint what the problem is but alas I have had no luck (I can't figure it if it's endian or floating point related or just something with the buffer. Any help would be greatly appreciated.
- (void)_audioQueue:(AudioQueueRef)audioQueue fillBuffer:(AudioQueueBufferRef)audioBuffer
{
int bufferSize = audioBuffer->mAudioDataBytesCapacity;
char *buffer = audioBuffer->mAudioData;
int size = 0;
do
{
int blockSize = ov_read(_oggStream, &((char *)buffer)[size], bufferSize - size, kIsBigEndian, 2, 1, nil);
if(blockSize > 0)
{
size += blockSize;
}
else
{
break;
}
}
while(size < bufferSize);
if(size == 0)
{
[self performSelectorOnMainThread:@selector(_streamDidEnd) withObject:nil waitUntilDone:NO];
}
else
{
audioBuffer->mAudioDataByteSize = size;
AudioQueueEnqueueBuffer(audioQueue, audioBuffer, 0, NULL);
}
}
Regards,
Jonathan Kantro
_______________________________________________
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