-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can not read audio from file. #57
Comments
Also, I have the same problem. |
Yeah, Can you give an example of how to analyze an audio file and get the |
What I found is a couple of issues in OutputSignalTracker which prevent the pitch output. First, installTap() has no effect on audioEngine - one has to substitute with audioPlayer. Second, the delegate in the closure was always nil so self.delegate?.signalTracker() was never called. Here is my replacement code which should give you an idea how to get some readings. It goes in the start() method of OutputSignalTracker. One must import Pitchy too.
One would then start the tracking with:
|
@jhristov perfect. Yep i replaced the following line in OutputSignalTracker::start audioEngine.outputNode.installTap(onBus: bus, bufferSize: bufferSize, format: nil) With audioPlayer.installTap(onBus: bus, bufferSize: bufferSize, format: nil) and everything else works. Good work |
When I specify the url variable to Config object, it will call OutputSignalTracker.start()function, but it can not enter this function and exit the program:
audioEngine.outputNode.installTap(onBus: bus, bufferSize: bufferSize, format: nil) { (buffer: AVAudioPCMBuffer!, time: AVAudioTime!) in
DispatchQueue.main.async {
self.delegate?.signalTracker(self, didReceiveBuffer: buffer, atTime: time)
}}
The text was updated successfully, but these errors were encountered: