• 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: Native Device Formats
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Native Device Formats


  • Subject: Re: Native Device Formats
  • From: "Mikael Hakman" <email@hidden>
  • Date: Sun, 8 Jun 2008 17:21:45 +0200
  • Organization: Datakonsulten AB

Many thanks Jeff!

AudioConverter tells me that in order to get the lowest 24-bit value (0x800000) I have to use -1.0 Float32 value (0xbf800000). In order to get highest 24-bit value (0x7fffff) I have to use 0.99999988 Float32 value (0x3f7ffffe). This means that FS amplitude when using Float32 is 0.99999944 (0x3f7fffff), not 1.0.

This may have some significance when e.g. generating FS precision test signals as in:

s = 0.99999944 * (sin (2 * PI * f * t) + 1.0) - 1.0

Omitting the scaling as in:

s = sin (2 * PI * f * t)

would result in a slight clipping on the positive side.

Could you please give some explanation why we are using this mapping as compared to (more intuitive) mapping of [-1.0, 1.0] to [0x800000, 0x7fffff] which would allow using sin() function results directly as input to CoreAudio?

Regards/Mikael

On Friday, June 06, 2008 8:27 PM, Jeff Moore wrote:


A 32 bit floating point number can losslessly encode a 24 bit integer sample. That's why we use it. So, as long as you are doing the conversion from 24 bit int to 32 bit float properly, it will come out of the 24 bit hardware properly.

The easiest way to do the conversion correctly is to use an AudioConverter or an AudioConverter-derived API like AUHAL or ExtendedAudioFile.

On Jun 6, 2008, at 5:41 AM, Mikael Hakman wrote:

Then the following question arises:

Starting with 24-bits signed integer values, how do I output them to a digital audio interface, so that the values appearing on the digital wire (S/PDIF) are exactly the same as those I have in my application? Consider a simple setup consisting of connecting MBP built-in digital output to its digital input. My application needs to output 24-bits signed integer values in such a way that the very same values are obtained on digital input. How do I do this?

On Thursday, June 05, 2008 8:16 PM, Jeff Moore wrote:


... But there is also conversion going on because we feed the driver floating point samples which then have to be converted to the appropriate integer format.



--

Jeff Moore
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

__________ NOD32 3165 (20080606) Information __________

Detta meddelande är genomsökt av NOD32 Antivirus.
http://www.nod32.com



_______________________________________________ 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: Native Device Formats
      • From: Brian Willoughby <email@hidden>
    • RE: Native Device Formats
      • From: "Richard Furse" <email@hidden>
References: 
 >Native Device Formats (From: email@hidden)
 >Re: Native Device Formats (From: Jeff Moore <email@hidden>)
 >Re: Native Device Formats (From: "Mikael Hakman" <email@hidden>)
 >Re: Native Device Formats (From: Jeff Moore <email@hidden>)

  • Prev by Date: Re: Native Device Formats
  • Next by Date: RE: Native Device Formats
  • Previous by thread: Re: Native Device Formats
  • Next by thread: RE: Native Device Formats
  • Index(es):
    • Date
    • Thread