feat: output device change
This commit is contained in:
@@ -385,6 +385,13 @@ Public Module ModMusic
|
||||
|
||||
Public Sub OnDefaultDeviceChanged(dataFlow As DataFlow, role As Role, defaultDeviceId As String) Implements IMMNotificationClient.OnDefaultDeviceChanged
|
||||
container.OnDefaultDeviceChanged(dataFlow, role, defaultDeviceId)
|
||||
' 切换到系统默认输出设备
|
||||
If MusicNAudio IsNot Nothing Then
|
||||
Dim target As NAudio.Wave.WaveOut = MusicNAudio
|
||||
target.Stop()
|
||||
target.DeviceNumber = 0
|
||||
target.Resume()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub OnDeviceAdded(deviceId As String) Implements IMMNotificationClient.OnDeviceAdded
|
||||
|
||||
Reference in New Issue
Block a user