I'm trying to emit white noise around specific center frequency inside bandwidth using AudioKit for iOS. Core of what I did so far looks like this:
class Manager {
private let noise = AKWhiteNoise(amplitude: Default.amplitude)
private lazy var filter: AKEqualizerFilter = {
let max = AKEqualizerFilter.gainRange.upperBound
return AKEqualizerFilter(noise, centerFrequency: Default.centerFrequency, bandwidth: Default.bandwidth, gain: max)
}()
var bandwidth: Double {
get {
return filter.bandwidth
}
set {
filter.bandwidth = newValue
}
}
var centerFrequency: Double {
get {
return filter.centerFrequency
}
set {
filter.centerFrequency = newValue
}
}
}
Noise is emitted, but that's how looks sound before playing noise and that's how after adding noise.
Does anyone knows what I'm doing wrong and how to fix sound to fit given center frequency and bandwidth?