Tag: 音效

iOS SoundTouch框架BPM检测示例

我search了整个networking,找不到关于如何使用SoundTouch库进行节拍检测的教程。 (注意:在这之前我没有C ++的经验,我知道C,Objective-C和Java,所以我可能会搞砸了一些,但是编译。 我添加了框架到我的项目,并设法得到以下编译: NSString *path = [[NSBundle mainBundle] pathForResource:@"song" ofType:@"wav"]; NSData *data = [NSData dataWithContentsOfFile:path]; player =[[AVAudioPlayer alloc] initWithData:data error:NULL]; player.volume = 1.0; player.delegate = self; [player prepareToPlay]; [player play]; NSUInteger len = [player.data length]; // Get the length of the data soundtouch::SAMPLETYPE sampleBuffer[len]; // Create buffer array [player.data getBytes:sampleBuffer length:len]; // Copy the […]