• 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
Why is this audio unit producing a distorted sound
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why is this audio unit producing a distorted sound


  • Subject: Why is this audio unit producing a distorted sound
  • From: Chaim Peck <email@hidden>
  • Date: Tue, 09 Jul 2013 02:13:23 -0400

Hello,

I am trying to get started with a very simple Audio Unit that is supposed to control volume. Here is what I have in my processing code:

void TestAudioUnit::TestAudioUnitKernel::Process(Float32 const* inSourceP, Float32 * inDestP, UInt32 inFramesToProcess, UInt32 inNumChannels, bool & ioSilence) {
    if (!ioSilence) {
        const Float32 *sourceP = inSourceP;

        

        Float32 *destP = inDestP,
        inputSample,
        outputSample,
        gain;

        

        gain = GetParameter (kParameter_Gain);

        

        for (int i = inFramesToProcess; i > 0; --i) {
            inputSample       = *inSourceP;
            outputSample      = (gain * inputSample);
            *destP            = outputSample;
            sourceP           += 1;
            destP             += 1;
        }
    }
}

---

When I use this plugin through AULab, I am hearing a distorted sound, even when the gain is set to 1.0. For that matter even if I change the outputSample to be direct (outputSample = inputSample), I am still getting a distorted sound. It goes away when I bypass the plugin.

Obviously, I am doing something incorrectly. I would appreciate any help in finding and resolving this.

Thanks!

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

  • Prev by Date: Re: P-eq tutorial?
  • Next by Date: Why is this audio unit producing a distorted sound
  • Previous by thread: Re: P-eq tutorial?
  • Next by thread: Why is this audio unit producing a distorted sound
  • Index(es):
    • Date
    • Thread