• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Getting wrong data format for stream
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting wrong data format for stream


  • Subject: Getting wrong data format for stream
  • From: Tom Harrington <email@hidden>
  • Date: Tue, 21 Jul 2009 15:03:11 -0600

I'm using Audio File Stream Services to play streaming audio from a web site.

The stream in question is MP3, 44100Hz, 112kbps, from a shoutcast
server (more details on request).  When I create the stream I provide
a file type hint of kAudioFileMP3Type.

Periodically, maybe one out of 8 times, I get bogus data for
kAudioFileStreamProperty_DataFormat.  It'll have an incorrect sample
rate (usually 32000Hz or 48000Hz) and a format of MP1
(kAudioFormatMPEGLayer1).  Playback then fails-- since I'm on iPhone,
AudioQueueNewOutput() returns kAudioFormatUnknownFormatError.

I look up the format by waiting for
kAudioFileStreamProperty_ReadyToProducePackets and then doing:

AudioStreamBasicDescription dataFormat;
UInt32 propertySize = sizeof(AudioStreamBasicDescription);
OSStatus audioStatus = AudioFileStreamGetProperty(inAudioFileStream,
kAudioFileStreamProperty_DataFormat, &propertySize, &dataFormat);

When I get bogus data, audioStatus is 0, but the returned format is
bogus.  What can I do to deal with this?

--
Tom Harrington
email@hidden
AIM: atomicbird1
 _______________________________________________
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

  • Follow-Ups:
    • Re: Getting wrong data format for stream
      • From: Brian Willoughby <email@hidden>
    • Re: Getting wrong data format for stream
      • From: james mccartney <email@hidden>
  • Prev by Date: Re: How to find root key info in AIFF File
  • Next by Date: Re: Getting wrong data format for stream
  • Previous by thread: Re: How to find root key info in AIFF File
  • Next by thread: Re: Getting wrong data format for stream
  • Index(es):
    • Date
    • Thread