Skip to content

Commit 6328521

Browse files
authored
Added a "dispose" method to PhaseLockedVocoder to clear the au wavetable (#40)
* Fixing a memory leak from not deallocating audio data pointer * Moved the deallocation of theData to the end * cleaned up unneeded deallocation in 164 * Added a "dispose" method to clear the au wavetable * removed white space * Corrected a default param value in ZitaReverb The value range is 160.0...1000.0, but the default value was 1500.0 Nothing bad happened because of this, but now it is more correct, with a default value of 1000.0.
1 parent 6183b95 commit 6328521

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Sources/SoundpipeAudioKit/Effects/ZitaReverb.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public class ZitaReverb: Node {
114114
identifier: "EQ Frequency 2",
115115
name: "EQ Frequency 2",
116116
address: akGetParameterAddress("ZitaReverbParameterEqualizerFrequency2"),
117-
defaultValue: 1500.0,
117+
defaultValue: 1000.0,
118118
range: 160.0 ... 1000.0,
119119
unit: .hertz
120120
)

Sources/SoundpipeAudioKit/Generators/PhaseLockedVocoder.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,12 @@ public class PhaseLockedVocoder: Node {
7979
self.amplitude = amplitude
8080
self.pitchRatio = pitchRatio
8181
}
82-
82+
83+
/// Call this function after you are done with the node, to reset the au wavetable to prevent memory leaks
84+
public func dispose() {
85+
au.setWaveTable([0.0])
86+
}
87+
8388
internal func loadFile(_ avAudioFile: AVAudioFile) {
8489
Exit: do {
8590
var err: OSStatus = noErr

0 commit comments

Comments
 (0)