Synthesizing music from sample wav files
Hi, I want to synthesize music with some given wav files on iOS.
The wav files don't cover all the notes so I figure pitch shifting is required to get them to the right pitch.
I think for pitch shifting I can try to use an Audio Unit?
I made one using something like this:
AEAudioUnitFilter *pitch = [[AEAudioUnitFilter alloc] initWithComponentDescription:AEAudioComponentDescriptionMake(kAudioUnitManufacturer_Apple, kAudioUnitType_FormatConverter,kAudioUnitSubType_NewTimePitch) audioController:_audioController error:&error];
AudioUnitSetParameter(pitch.audioUnit, kAudioUnitScope_Global, 0, kNewTimePitchParam_Pitch, 800, 0);
[_audioController addFilter:pitch toChannel:_audioFilePlayer];
but for some reason the wav file plays once and then again with the audio unit applied to it. I think. I'm not sure what's happening but that's what it sounds like. I don't know what parameters I can pass into the kNewTimePitchParam_Pitch as well.
the other issue is the time. The wav file is only a fraction of a second long, how would I extend it to be longer or shorter?