AudioKit / AudioKit

Audio synthesis, processing, & analysis platform for iOS, macOS and tvOS

Home Page:http://audiokit.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FFTTap crash

EnjoyWT opened this issue · comments

macOS Version(s) Used to Build

macOS 13 Ventura

Xcode Version(s)

Xcode 14

Description

1. I just try to use FFTTap , but when it use it like this , the code crash.
xcode version 15.1

bufferSize = 1024
fftTap = FFTTap(mic, bufferSize: UInt32(bufferSize),fftValidBinCount: .thirtyTwo, callbackQueue: .main, handler: {[weak self] fs in
         guard let self = self else{return}
         print(fs)
     }) 

fftTap crash .
截屏2024-01-26 11 40 26
RawBufferTap works fine

speechTap =  RawBufferTap(mic, bufferSize: UInt32(bufferSize), callbackQueue: .main) {[weak self] buffer,when  in
  guard let self = self else{return}
    buffer.frameLength = AVAudioFrameCount(bufferSize)
    let spectra = self.analyzer.analyse(with: buffer)
    self.spectrumView.spectra = spectra

}

2. When i change the buffer to 4096 there have other crash
截屏2024-01-26 11 52 07

And the output

截屏2024-01-26 11 54 11

Crash Logs, Screenshots or Other Attachments (if applicable)

No response

This appears to be an implementation bug. Are you trying to tap the same node twice? You can't. FFTTap is used in a few apps so I know it is working.