• 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
Re: Streaming Audio - AudioFileStream, CFReadStreamRead and AudioQueue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Streaming Audio - AudioFileStream, CFReadStreamRead and AudioQueue


  • Subject: Re: Streaming Audio - AudioFileStream, CFReadStreamRead and AudioQueue
  • From: Erik Aigner <email@hidden>
  • Date: Wed, 30 Jul 2008 14:16:43 +0200

Your problem is that your allocating the buffer but not writing any data to it.

void audioFileStream_Packets (void *inClientData,
                             UInt32 inNumberBytes,
                             UInt32 inNumberPackets,
                             const void *inInputData,
                             AudioStreamPacketDescription *inPacketDescs) {

   customData.mNumPackets = inNumberPackets;
   customData.mPacketDescs = inPacketDescs;

   AudioQueueBufferRef outBuffer;
   AudioQueueAllocateBuffer(customData.mQueue, inNumberBytes, &outBuffer);
   AudioOutputCallBack(&customData, customData.mQueue, outBuffer);

}

You don't write the needed const void *inInputData to your buffer.
I don't know how to write data to an AudioQueue that's in memory 
(only AudioFileReadPackets which does this for a file), however i found 
a method that works for me.

Save the audiodata continuously to a temporary file and use the AudioQueue 
sample project apple provides to read from that file (while the other process
is appending data to its end).

This works pretty nice
 _______________________________________________
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: Streaming Audio - AudioFileStream, CFReadStreamRead and AudioQueue
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Streaming Audio - AudioFileStream, CFReadStreamRead and AudioQueue
  • Next by Date: Re: Problem creating and using aggregate device
  • Previous by thread: Re: Streaming Audio - AudioFileStream, CFReadStreamRead and AudioQueue
  • Next by thread: Re: Streaming Audio - AudioFileStream, CFReadStreamRead and AudioQueue
  • Index(es):
    • Date
    • Thread