• 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: Not Setting Format results in multichannel playback success
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Not Setting Format results in multichannel playback success


  • Subject: Re: Not Setting Format results in multichannel playback success
  • From: Doug Wyatt <email@hidden>
  • Date: Fri, 7 Jul 2006 13:26:54 -0700

On Jul 6, 2006, at 23:24 , Mike Hanna wrote:
I finally have playback of multichannel audio with code based on PlayFile.cpp.

Using AudioFileGetProperty(), I load a file into a buffer:

XThrowIfError (AudioFileGetProperty(fAudioFile, kAudioFilePropertyDataFormat, &propsize, &fFileFormat), "AudioFileGetProperty");


I could not get sound when playing a multichannel file; I thought it was because I wasn't using SetFormat(), but it apparently it causes an exception, of which kind I don't know:


http://paste.lisp.org/display/22194

/*** using SetFormat seems to cause an exception, any idea why? ***/

I finally decided to comment-out any code that calls SetNumberChannels() or SetSampleRate(). Removing these results in successful playback of multichannel audio, any idea why?

/*** commenting-out these lines results in successful playback of multichannel audio, why? ***/

XThrowIfError( fFileAU.SetFormat( kAudioUnitScope_Input, 0, fFileFormat ), "SetFormat" );
// printf ("makeGraph file in: ");
// XThrowIfError( fFileAU.SetFormat( kAudioUnitScope_Output, 0, fFileFormat ), "SetFormat" );
// printf ("makeGraph file out: ");

These probably fail because fFileFormat is something other than deinterleaved Float32.


// prepare the file AU for playback
// set its output channels
// XThrowIfError (fFileAU.SetNumberChannels (kAudioUnitScope_Output, 0, fFileFormat.NumberChannels()), "SetNumberChannels");
// set the output sample rate of the file AU to be the same as the file:
// XThrowIfError (fFileAU.SetSampleRate (kAudioUnitScope_Output, 0, fFileFormat.mSampleRate), "SetSampleRate");

It's not clear why these should fail before connecting and initialization. What's the error?


Doug

--
Doug Wyatt
Core Audio, Apple

_______________________________________________
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: Not Setting Format results in multichannel playback success
      • From: Mike Hanna <email@hidden>
References: 
 >Not Setting Format results in multichannel playback success (From: Mike Hanna <email@hidden>)

  • Prev by Date: Re: how do I change bitsperchannel value
  • Next by Date: Recording to AAC format, basic questions
  • Previous by thread: Not Setting Format results in multichannel playback success
  • Next by thread: Re: Not Setting Format results in multichannel playback success
  • Index(es):
    • Date
    • Thread