• 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: Marc Van Olmen <email@hidden>
  • Date: Sat, 23 Sep 2006 12:40:20 -0400


On 21 Sep 2006, at 13:03, Brad Ford wrote:

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);

In the end this didn't work because SoundConverterSetInfo returned error -231 (siUnknownInfoType) I was testing on DV audio


so I did the following: because the decompressed samples are being send to coreAudio for output.


typedef UInt32 My_Float32; My_Float32 * aDataPtr_left = NULL; My_Float32 * aDataPtr_right = NULL; My_Float32 * aReadPointer;

	for (i=0;i<aFloatCount;i++) {
		*aDataPtr_left++ =  CFSwapInt32BigToHost(aReadPointer[0]); //
		*aDataPtr_right++ = CFSwapInt32BigToHost(aReadPointer[1]);
		aReadPointer += 2;
	}







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

I know I know:-) just need to find 2-3 weeks of time etc...because need to support DV etc... will do it soon promised:-)
_______________________________________________
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: Brad Ford <email@hidden>
References: 
 >CoreAudio on macintel no Sound... (From: Marc Van Olmen <email@hidden>)
 >Re: CoreAudio on macintel no Sound... (From: Brad Ford <email@hidden>)

  • Prev by Date: Re: Re: AU surround hosts
  • Next by Date: Re: upsampling and CompressionInfo
  • Previous by thread: Re: CoreAudio on macintel no Sound...
  • Next by thread: Re: CoreAudio on macintel no Sound...
  • Index(es):
    • Date
    • Thread