• 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: AudioFilePlayer & 4-channel wav file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AudioFilePlayer & 4-channel wav file


  • Subject: Re: AudioFilePlayer & 4-channel wav file
  • From: William Stewart <email@hidden>
  • Date: Mon, 24 Oct 2005 11:31:30 -0700


On 23/10/2005, at 2:12 AM, Mike Aizatsky wrote:

Hi!

I've successfully set up an AU graph:  file player -> mixer -> effect
-> output unit. Everything works correctly, until I'm feeding the
4-channel wav file into file player. Despite all my efforts it still
has only 2 channels on exit.

Are you setting the output format on the FilePlayer? You would need to do this *before* you connect it to something. You'll also find I think that CAStreamBasicDescription (in PublicUtility) has a good set of utilities for setting up and printing these structs.



Here's the file format description:

- - - - - - - - - - - - - - - - - - - -
  Sample Rate:22050.000000
  Format ID:lpcm
  Format Flags:C
  Bytes per Packet:8
  Frames per Packet:1
  Bytes per Frame:8
  Channels per Frame:4
  Bits per Channel:16
- - - - - - - - - - - - - - - - - - - -

For this file, AUFilePlayer says it has the following output format:

- - - - - - - - - - - - - - - - - - - -
  Sample Rate:44100.000000
  Format ID:lpcm
  Format Flags:2B
  Bytes per Packet:4
  Frames per Packet:1
  Bytes per Frame:4
  Channels per Frame:2
  Bits per Channel:32
- - - - - - - - - - - - - - - - - - - -


It even ignore my manual output format setup:

------------------------
    AudioStreamBasicDescription		filePlayerDesc;
    dataSize = sizeof(AudioStreamBasicDescription);

    filePlayerDesc.mFormatID = kAudioFormatLinearPCM;
    filePlayerDesc.mFormatFlags = kAudioFormatFlagsNativeFloatPacked;
    filePlayerDesc.mBitsPerChannel = 32;
    filePlayerDesc.mChannelsPerFrame = 4;
    filePlayerDesc.mFramesPerPacket = 1;
    filePlayerDesc.mBytesPerPacket = filePlayerDesc.mBytesPerFrame =
sizeof(Float32) * filePlayerDesc.mChannelsPerFrame;
    filePlayerDesc.mFormatFlags |= kAudioFormatFlagIsNonInterleaved;
    verify_noerr( AudioUnitSetProperty(myFilePlayerUnit,

kAudioUnitProperty_StreamFormat,kAudioUnitScope_Output, 0,&filePlayerDesc,dataSize));
----------------------------


Any hints, how can I have 4 channels of output to mix it in the mixer
from file player unit?

Is this being done *before* you connect it to the mixer? Also, which mixer AU?


Bill


-- Regards, Mike _______________________________________________ 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

--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________ __
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________ __


_______________________________________________
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


References: 
 >AudioFilePlayer & 4-channel wav file (From: Mike Aizatsky <email@hidden>)

  • Prev by Date: Re: Efficient functions to convert 24 bit WAV audio into Float32
  • Next by Date: Getting the description of an AUHAL output node
  • Previous by thread: AudioFilePlayer & 4-channel wav file
  • Next by thread: Sound bug - must be a short integer problem
  • Index(es):
    • Date
    • Thread