0
votes

I have an application in which user can record audio and play it with some change in pitch. And the output volume power should also be measured. I know about metering properties of avaudioplayer and cocos sound engines. But using these I can't do my needs together. How I can Do these(pitch shifting and level metering) together. Can anybody help me.

EDIT

  CDSoundEngine *soundEngine = [[CDSoundEngine alloc] init];

 NSArray *defs = [NSArray arrayWithObjects: [NSNumber numberWithInt:1],nil]; 
        [soundEngine defineSourceGroups:defs];
[soundEngine loadBuffer: 0 filePath: soundPath];
   ALuint soundID= [soundEngine playSound: 0 sourceGroupId: 0 pitch: PITCH pan: 0.0f gain: 2.0f loop: NO];

This is the code I am currently using it works fine but I cant measure the output power. In the case of AVAudioPlayer there is a property meteringenabled

[player setMeteringEnabled:YES];

and we can retrieve the power by

  [player updateMeters];
    Float32 peak=[player peakPowerForChannel:0];

But I cant change the pitch by AVAudioPlayer

This is my problem

2
@MDT I have added relevent codesJohnykutty

2 Answers

1
votes

@johnykutty there is no option to change the sound by using avaudio player.you need to go through external libraries for getting pitch changed....

1
votes

there is a way using a external library: Dirac3 audio library - http://dirac.dspdimension.com/Dirac3_Technology_Home_Page/Dirac3_Technology.html

A simple tutorial is available here: http://purplelilgirl.tumblr.com/post/3915153445/tutorial-other-ways-to-chipmunkify-your-voice

But the license costs 1000 eur. There is a free version but you have to read the license agreement to find out whether you can use it in commercial products (if i have read the agreement correctly you can use it as long as you give credits to the author).