Audio streams that do not recognize the file type

I worked on streaming live audio using the Audio Streaming Services library (based on the Matt Ghallager tutorial ), and I continued to crash on this part:

err = AudioQueueStart(audioQueue, NULL);
if (err)
{
    [self failWithErrorCode:AS_AUDIO_QUEUE_START_FAILED];
    return;
}

error code: kAudioDeviceUnsupportedFormatError .. this guy is defined in CoreAudio / AudioHardware.h, which seems to be hardware related, I could not find much useful information about this error on the Internet.

The interesting part is that I used to encounter a similar problem when trying this:

// create the audio 
err = AudioQueueNewOutput(&asbd, MyAudioQueueOutputCallback, self, NULL, NULL, 0, &
    if (err)
{
    [self failWithErrorCode:AS_AUDIO_QUEUE_CREATION_FAILED];
    return;
}

(the same problem was encountered in this , but the author of the message mistakenly attributed his error code AudioQueueStart, not AudioQueueNewOutput)

: kAudioFormatUnsupportedDataFormatError.. :

asbd.mFormatID = kAudioFormatMPEGLayer3;

,

AudioFileStreamGetProperty(inAudioFileStream, kAudioFileStreamProperty_DataFormat, &asbdSize, &asbd);

kAudioFormatMPEGLayer1 mFormatID, kAudioFormatMPEGLayer3, .mp3, , .

.. , , , - , , :

AudioFileStreamOpen((__bridge void*)streamer, ASPropertyListenerProc, ASPacketsProc, 
                                        0, &(streamer->audioFileStream));

, inFileTypeHint

+1
1

, ( , ). , (hexFiend), mp3, , , . , .

0

Source: https://habr.com/ru/post/1718278/


All Articles