Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
[ad_1]
I’ve loaded an audio file and have created an enter and output buffer.
However once I comply with Apple’s publish I get an output sign that has distorted sounds.
non-public func extractSignal(enter: AVAudioPCMBuffer, output: AVAudioPCMBuffer) {
let rely = 256
let ahead = vDSP.DCT(earlier: nil, rely: rely, transformType: .II)!
let inverse = vDSP.DCT(earlier: nil, rely: rely, transformType: .III)!
// Iterates over the sign.
enter.iterate(signalCount: 32000) { step, sign in
var collection = ahead.remodel(sign)
collection = vDSP.threshold(collection, to: 0.0003, with: .zeroFill) // What ought to this threshold be?
var inversed = inverse.remodel(collection)
let divisor: Float = Float(rely / 2)
inversed = vDSP.divide(inversed, divisor)
// Code: write inversed to output buffer.
output.frameLength = AVAudioFrameCount(step * sign.rely + sign.rely)
}
}
[ad_2]