mattgallagher / AudioStreamer

A streaming audio player class (AudioStreamer) for Mac OS X and iPhone.
http://cocoawithlove.com
1.93k stars 553 forks source link

1752656245 (hwiu) returned from AudioQueueStart #5

Open coneybeare opened 14 years ago

coneybeare commented 14 years ago

My app uses AVAudioPlayers for local sounds in addition to AudioStreamer for remote sounds.

Audio streamer works great by itself, but after playing a local sound (using the hardware decoder) an AudioStreamer cannot be instantiated and returns error code 1752656245 (hwiu)

http://developer.apple.com/iphone/library/documentation/musicaudio/reference/audioconverterservicesreference/Reference/reference.html

Looking at the docs doesn't really help in this case, or at least I don't understand enough about what is going on to figure it out. Is this an AudioStreamer bug or am I doing something wrong?

coneybeare commented 14 years ago

for lack of a better solution right now, I added a hardware preference override to the audioqueue in "createqueue" line 1494

// set the software codec too on the queue.
UInt32 val = kAudioQueueHardwareCodecPolicy_PreferSoftware;
OSStatus ignorableError;
ignorableError = AudioQueueSetProperty(audioQueue, kAudioQueueProperty_HardwareCodecPolicy, &val, sizeOfUInt32);
if (ignorableError)
{
    return;
}
coneybeare commented 14 years ago

wrote it up in more detail here http://code.coneybeare.net/using-audiostreamer-with-avaudioplayer-and-av

xuzepei commented 14 years ago

I have the same problem. Thanks coneybeare.

jkap commented 14 years ago

I feel like you should probably add this to a fork and request it be added into the main code base.

nmaisonneuve commented 14 years ago

Yes , Playing multiple sounds doesn't work. thanks for the fix. This patch should be officially committed for this issue.