• 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: CoreAudio on macintel no Sound...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreAudio on macintel no Sound...


  • Subject: Re: CoreAudio on macintel no Sound...
  • From: Brad Ford <email@hidden>
  • Date: Thu, 21 Sep 2006 10:03:12 -0700


On Sep 21, 2006, at 5:38 AM, Marc Van Olmen wrote:

hi,

Now I got my macpro I just started converted my coreAudio application to Intel.
I noticed I can't hear any sound. Just wondering if somebody else had the same issues when they first ported their app.


was thinking maybe something to do with samplerate conversion on intel machine:

UnsignedFixed ConvertFloat64ToUnsignedFixed(Float64 float64Value)
{
    UnsignedFixed fixedValue;

// High 2 bytes is the integer part of the value
// Low 2 bytes is the floating point part of the value
fixedValue = ((UInt32)float64Value << 16) + ((UInt16) ((float64Value - floor(float64Value)) * 65536.0));


    return fixedValue;
}

because I'm using Sound comressor to decompress my frames: so i have to set it up..


fSoundOutputComponentData.numChannels = outputCoreAudioFormat.mChannelsPerFrame;
fSoundOutputComponentData.sampleSize = outputCoreAudioFormat.mBitsPerChannel;
fSoundOutputComponentData.sampleRate = ConvertFloat64ToUnsignedFixed(outputCoreAudioFormat.mSampleRate);
fSoundOutputComponentData.sampleCount = 0;
fSoundOutputComponentData.buffer = NULL; ///CFSw
fSoundOutputComponentData.reserved = 0;



I tried converting the floats to littleendian because read somewhere that Soundmanager only does big endian.

No. SoundConverter can do little endian floats as well, but you have to set up your siDecompression/siCompressionParams correctly. There's a little extension that tells whether the floats are big or little endian:


// add the extension that says "it's little endian".
Handle extension = NULL;
AudioFormatAtom formatData = {0};
AudioEndianAtom endianData = {0};
AudioTerminatorAtom terminatorData = {0};

formatData.size = EndianU32_NtoB(sizeof(AudioFormatAtom));
formatData.atomType = EndianU32_NtoB(kAudioFormatAtomType);
formatData.format = EndianU32_NtoB('fl32');
err = PtrToHand(&formatData, &extension, sizeof(AudioFormatAtom));
if (err)
goto bail;


endianData.size = EndianU32_NtoB(sizeof(AudioEndianAtom));
endianData.atomType = EndianU32_NtoB(kAudioEndianAtomType);
endianData.littleEndian = EndianU16_NtoB(1);
err = PtrAndHand(&endianData, extension, sizeof(AudioEndianAtom));
if (err)
goto bail;

terminatorData.size = EndianU32_NtoB(sizeof(AudioTerminatorAtom));
terminatorData.atomType = EndianU32_NtoB(kAudioTerminatorAtomType);
err = PtrAndHand(&terminatorData, extension, sizeof (AudioTerminatorAtom));
if (err)
goto bail;


SoundConverterSetInfo(soundConverterInstance, siDecompressionParams, *extension);

				DisposeHandle(extension);


The one caveat in all this is that SoundManager is deprecated and you should move over to CoreAudio asap.


-Brad Ford
QuickTime Engineering


regards


marc _______________________________________________ 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

_______________________________________________ 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: CoreAudio on macintel no Sound...
      • From: Marc Van Olmen <email@hidden>
References: 
 >CoreAudio on macintel no Sound... (From: Marc Van Olmen <email@hidden>)

  • Prev by Date: CoreAudio on macintel no Sound...
  • Next by Date: Re: Testing Debugging Hosting AU Instruments
  • Previous by thread: CoreAudio on macintel no Sound...
  • Next by thread: Re: CoreAudio on macintel no Sound...
  • Index(es):
    • Date
    • Thread