Skip to content

Commit a1c6c64

Browse files
committed
Added a "dispose" method to clear the au wavetable
1 parent b418616 commit a1c6c64

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Sources/SoundpipeAudioKit/Generators/PhaseLockedVocoder.swift

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

0 commit comments

Comments
 (0)