• 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
converting audio signal to buffer value
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

converting audio signal to buffer value


  • Subject: converting audio signal to buffer value
  • From: Roland Silver <email@hidden>
  • Date: Wed, 26 Mar 2008 16:45:41 -0600

If I have an audio signal as a double in the range -1.0 to 1.0, what is the proper way to convert it to an integer (SInt16?) as a value to be entered into an audio buffer?

I tried this, but it resulted in horrible distortion:
((SInt16*)((&(ioData->mBuffers[0]))->mData))[k] = (SInt16)(signal * 32768.0 + 0.5);

Roland Silver
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: converting audio signal to buffer value
      • From: William Stewart <email@hidden>
  • Prev by Date: AudioUnitSetProperty
  • Next by Date: Re: MIDI driver hibernation problem
  • Previous by thread: Re: AudioQueue and Seeking in a VBR file
  • Next by thread: Re: converting audio signal to buffer value
  • Index(es):
    • Date
    • Thread