• 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: AudioConverter 8.24 to Float32
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AudioConverter 8.24 to Float32


  • Subject: Re: AudioConverter 8.24 to Float32
  • From: William Stewart <email@hidden>
  • Date: Thu, 13 Nov 2008 18:17:25 -0800

Yes - using floating point on the phone/touch is not a good thing for general DSP work - that is why we provided the 8.24 canonical version and why we would recommend that audio DSP is done in fixed point. It can be done in floating point of course, but it is slow

Bill

On Nov 11, 2008, at 11:08 PM, Mark's Studio wrote:


On 11/11/2008, at 23.10, William Stewart wrote:

(Oh and just to be clear, float is not currently supported on iPhone - it is on the desktop)

??? do you mean i can't use the AudioConverter to convert to float on the iPhone ?




Float64 sampleRate;
size = sizeof(sampleRate);
XThrowIfError (AudioSessionGetProperty (kAudioSessionProperty_CurrentHardwareSampleRate, &size, &sampleRate), "couldn't get new sample rate");
CAStreamBasicDescription destFormat;
CAStreamBasicDescription srcFormat;
outFormat.mSampleRate = sampleRate;

srcFormat.mSampleRate = outFormat.mSampleRate;
srcFormat.mFormatID = outFormat.mFormatID;
srcFormat.mFormatFlags = outFormat.mFormatFlags;
srcFormat.mBytesPerPacket = outFormat.mBytesPerPacket;
srcFormat.mFramesPerPacket = outFormat.mFramesPerPacket;
srcFormat.mBytesPerFrame = outFormat.mBytesPerFrame;
srcFormat.mChannelsPerFrame = 1;
srcFormat.mBitsPerChannel = outFormat.mBitsPerChannel;

destFormat.mSampleRate = outFormat.mSampleRate;
destFormat.mFormatID = kAudioFormatLinearPCM;
destFormat.mFormatFlags = kAudioFormatFlagIsFloat | kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsPacked;
destFormat.mBytesPerPacket = outFormat.mBytesPerPacket;
destFormat.mFramesPerPacket = outFormat.mFramesPerPacket;
destFormat.mBytesPerFrame = outFormat.mBytesPerFrame;
destFormat.mChannelsPerFrame = 1;
destFormat.mBitsPerChannel = outFormat.mBitsPerChannel;


outFormat.Print(outFormat);
srcFormat.Print(srcFormat);
destFormat.Print(destFormat);

XThrowIfError(AudioConverterNew(&srcFormat, &destFormat, &audioConverter), "couldn't get AudioConverterNew");


and then in PerformThru()

AudioUnitRender()
AudioConverterConvertBuffer(....ioData->mBuffer[0].mData,...)

i get a -50 error from AudioConverterConvertBuffer()

is this not possible ?




On Nov 11, 2008, at 2:08 PM, William Stewart wrote:

float is not supported

On Nov 11, 2008, at 7:26 AM, Mark's Studio wrote:

In the aurioTouch sampleCode the format is 8.24 i have tried to add a AudioConverterNew to convert to float, but either i get a -50, or a !fmt error,
it look's like there is already an AudioConverter running maybe for the 16bit to 8.24,
how do i setup the format for the AudioConverterNew so i can have Float32 instead of 8.24,
i am mostly interested in converting the input buffer.






Peter Mark

Mark's Recording Studio A/S
Lundeskovsvej 3
2900 Hellerup
Denmark
Tel: +45 35366078
Fax: +45 35366038
Mobile: +45 20416018
www.marks-studio.dk
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

_______________________________________________ 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


Peter Mark

Mark's Recording Studio A/S
Lundeskovsvej 3
2900 Hellerup
Denmark
Tel: +45 35366078
Fax: +45 35366038
Mobile: +45 20416018
www.marks-studio.dk
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: AudioConverter 8.24 to Float32
      • From: Benjamin Faber <email@hidden>
    • Re: AudioConverter 8.24 to Float32
      • From: "tahome izwah" <email@hidden>
References: 
 >AudioConverter 8.24 to Float32 (From: Mark's Studio <email@hidden>)
 >Re: AudioConverter 8.24 to Float32 (From: William Stewart <email@hidden>)
 >Re: AudioConverter 8.24 to Float32 (From: William Stewart <email@hidden>)
 >Re: AudioConverter 8.24 to Float32 (From: Mark's Studio <email@hidden>)

  • Prev by Date: Re: Playing pls files with core audio
  • Next by Date: Re: Bug 5635229: default audio stream misbehaviour
  • Previous by thread: Re: AudioConverter 8.24 to Float32
  • Next by thread: Re: AudioConverter 8.24 to Float32
  • Index(es):
    • Date
    • Thread