title: How to set AudioStreamBasicDescription properties?
body: <p>I'm trying to play PCM stream data from server using AudioQueue.</p>
  
  <p>PCM data format : </p>
  
  <pre><code>Sample rate = 48000, num of channel = 2, Bit per sample = 16
  </code></pre>
  
  <p>And, server is not streaming fixed bytes to client. (variable bytes.)
  (ex : 30848, 128, 2764, ... bytes )</p>
  
  <p>How to set ASBD ?
  I don't know how to set <code>mFramesPerPacket</code>, <code>mBytesPerFrame</code>, <code>mBytesPerPacket</code> .
  I have read Apple reference document, but there is no detailed descriptions.</p>
  
  <p>Please give me any idea.</p>
  
  <p><strong>New added :</strong>  Here, ASBD structure  what I have setted. (language : Swift)</p>
  
  <pre><code>// Create ASBD structure &amp; set properties.
  var streamFormat = AudioStreamBasicDescription()
  
  streamFormat.mSampleRate = 48000
  streamFormat.mFormatID = kAudioFormatLinearPCM
  streamFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked
  streamFormat.mFramesPerPacket = 1
  streamFormat.mChannelsPerFrame = 2
  streamFormat.mBitsPerChannel = 16
  
  streamFormat.mBytesPerFrame = (streamFormat.mBitsPerChannel / 8) * streamFormat.mChannelsPerFrame
  streamFormat.mBytesPerPacket = streamFormat.mBytesPerFrame
  streamFormat.mReserved = 0
  
  // Create AudioQueue for playing PCM streaming data.
  var err = AudioQueueNewOutput(&amp;streamFormat, self.queueCallbackProc, nil, nil, nil, 0, &amp;aq)
  
  ...
  </code></pre>
  
  <p>I have setted ASBD structure like the above. </p>
  
  <p>AudioQueue play streamed PCM data very well for a few seconds, </p>
  
  <p>but soon playing is stop. What can I do?</p>
  
  <p>(still streaming, and queueing AudioQueue)</p>
  
  <p>Please give me any idea.</p>