Skip to content

Commit 4034f1b

Browse files
virtustilusnodeful
authored andcommitted
Added a delay to processing listener statement on Sample Rate changes, since it's cleared listeners after re-subscribing
1 parent d39060e commit 4034f1b

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

native/app/Source/Application.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,13 @@ class Application {
325325
retain: false
326326
) {
327327
// selectOutput(device: selectedDevice)
328-
stopListeners()
329-
stopEngines()
330-
self.matchDriverSampleRateToOutput()
331-
createAudioPipeline()
328+
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
329+
// need a delay, because emitter should finish it's work at first
330+
stopListeners()
331+
stopEngines()
332+
self.matchDriverSampleRateToOutput()
333+
createAudioPipeline()
334+
}
332335
}
333336

334337
selectedDeviceVolumeChangedListener = AudioDeviceEvents.on(

0 commit comments

Comments
 (0)