Skip to content

Latest commit

 

History

History
56 lines (32 loc) · 1.19 KB

README.md

File metadata and controls

56 lines (32 loc) · 1.19 KB

ScreenShot

Features

  • Using Accelerate framework to meter input power level

How to use



self.karaoke = [[DEKaraokeController alloc] initWithBgMusic:[self bgMp3FileURL] outputURL:[self recordFileURL]];
 
....

- (IBAction)onStart:(id)sender {
    UIButton *btn = sender;
    if(self.karaoke.isRunning == NO){
        __weak ViewController *weakSelf = self;

        [self.karaoke startWithPowerLevelChangeCallback:^(float p)  {
            weakSelf.meterLabel.text = [NSString stringWithFormat:@"%f",p];
        } musicFinishCallback:^{
            weakSelf.recordBtn.selected = NO;
            weakSelf.replayBtn.enabled = YES;
        }];

        btn.selected = YES;
        self.replayBtn.enabled = NO;

}else{
      //stop
      [self.karaoke stop];
      self.recordBtn.selected = NO;
      self.replayBtn.enabled = YES;

   }

}




References

https://blog.metova.com/audio-manipulation-using-avaudioengine

https://stackoverflow.com/questions/30641439/level-metering-with-avaudioengine

License

This code is distributed under the terms and conditions of the MIT license.