commit
08287bc6a7
|
|
@ -1,6 +1,6 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = "Audjustable"
|
||||
s.version = "0.0.4"
|
||||
s.version = "0.0.5"
|
||||
s.summary = "A fast and extensible audio streamer for iOS and OSX with support for gapless playback and custom (non-HTTP) sources."
|
||||
s.homepage = "http://tumtumtum.github.com/audjustable/"
|
||||
s.license = 'MIT'
|
||||
|
|
|
|||
|
|
@ -605,12 +605,13 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
|
|||
break;
|
||||
case kAudioFileStreamProperty_DataFormat:
|
||||
{
|
||||
AudioStreamBasicDescription newBasicDescription;
|
||||
UInt32 size = sizeof(newBasicDescription);
|
||||
|
||||
AudioFileStreamGetProperty(inAudioFileStream, kAudioFileStreamProperty_DataFormat, &size, &newBasicDescription);
|
||||
|
||||
currentlyReadingEntry->audioStreamBasicDescription = newBasicDescription;
|
||||
if (currentlyReadingEntry->audioStreamBasicDescription.mSampleRate == 0) {
|
||||
AudioStreamBasicDescription newBasicDescription;
|
||||
UInt32 size = sizeof(newBasicDescription);
|
||||
|
||||
AudioFileStreamGetProperty(inAudioFileStream, kAudioFileStreamProperty_DataFormat, &size, &newBasicDescription);
|
||||
currentlyReadingEntry->audioStreamBasicDescription = newBasicDescription;
|
||||
}
|
||||
|
||||
currentlyReadingEntry->sampleRate = currentlyReadingEntry->audioStreamBasicDescription.mSampleRate;
|
||||
currentlyReadingEntry->packetDuration = currentlyReadingEntry->audioStreamBasicDescription.mFramesPerPacket / currentlyReadingEntry->sampleRate;
|
||||
|
|
@ -652,6 +653,44 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
|
|||
discontinuous = YES;
|
||||
}
|
||||
break;
|
||||
case kAudioFileStreamProperty_FormatList:
|
||||
{
|
||||
Boolean outWriteable;
|
||||
UInt32 formatListSize;
|
||||
OSStatus err = AudioFileStreamGetPropertyInfo(inAudioFileStream, kAudioFileStreamProperty_FormatList, &formatListSize, &outWriteable);
|
||||
if (err)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
AudioFormatListItem *formatList = malloc(formatListSize);
|
||||
err = AudioFileStreamGetProperty(inAudioFileStream, kAudioFileStreamProperty_FormatList, &formatListSize, formatList);
|
||||
if (err)
|
||||
{
|
||||
free(formatList);
|
||||
break;
|
||||
}
|
||||
|
||||
for (int i = 0; i * sizeof(AudioFormatListItem) < formatListSize; i += sizeof(AudioFormatListItem))
|
||||
{
|
||||
AudioStreamBasicDescription pasbd = formatList[i].mASBD;
|
||||
|
||||
if (pasbd.mFormatID == kAudioFormatMPEG4AAC_HE ||
|
||||
pasbd.mFormatID == kAudioFormatMPEG4AAC_HE_V2)
|
||||
{
|
||||
//
|
||||
// We've found HE-AAC, remember this to tell the audio queue
|
||||
// when we construct it.
|
||||
//
|
||||
#if !TARGET_IPHONE_SIMULATOR
|
||||
currentlyReadingEntry->audioStreamBasicDescription = pasbd;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
free(formatList);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue