What is the best way to change AudioPitch withOut noise

281 views Asked by At

I am very new about voice changer apps.Can any one Please suggest me the way to change the pitch like girl voice.

here is the code what i used.

audioPlayerNode=[[AVAudioPlayerNode alloc]init];

    [audioEngine attachNode:audioPlayerNode];

    changePitchEffect=[[AVAudioUnitTimePitch alloc]init];
      changePitchEffect.pitch=pitch;
 [audioEngine attachNode:changePitchEffect];


[audioEngine connect:audioPlayerNode to:changePitchEffect format:audioFile.processingFormat ];

[audioEngine connect:changePitchEffect to:audioEngine.outputNode format:processingFormat];

[audioPlayerNode scheduleFile:audioFile atTime:nil completionHandler:nil ];

    AVAudioInputNode *input = [audioEngine inputNode];
    AVAudioFormat *format = [input outputFormatForBus: 0];

    [audioEngine prepare];

    [audioEngine startAndReturnError:nil];

after changing the pitch of audioFile i missing clarity and got more disturbance.can any one suggest the solution for this

1

There are 1 answers

2
shallowThought On

That is not a trivial task. Basically you have to shift the sounds formants rather than the overall pitch.

Imagine a man and a woman singing the same note. Despite they are singing the same note (meaning their sounds are actually in the same pitch), you can still recognize the difference in-between man and woman. The cause therefore is the different formants. You can think of formants as of a prescinded range whithin the frequency spectrum.

I am not aware of an Obj-C/Swift framework offering formant shifting. I assume you will find basic C++ solutions out there.

If you want/have to implement it yourself, you most probably have to use Core Audio and do the DSP yourself. In this case, I would recommend to create a working prototype in Matlab/Octave or a graphical DSP programming software like Native Instrument's "Reaktor" before starting to implement in Obj-C/Swift.

As said, this is a non trivial task.


Depending on your requirements you can certainly experiment with different combinations and settings of pitch changes and EQs, but the result will always be "toy like".