mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-28 00:04:33 +02:00
Actually fix the music sharing its volume with the soundeffects
This commit is contained in:
parent
bd290df9bb
commit
620f4d8325
@ -94,7 +94,7 @@ Public Class MusicManager
|
||||
Private Shared _isFadingIn As Boolean = False
|
||||
' NAudio properties
|
||||
Public Shared outputDevice As WaveOutEvent
|
||||
Public Shared audioFile As VorbisWaveReader
|
||||
Public Shared audioFile As WaveChannel32
|
||||
Public Shared _loop As WaveStream
|
||||
|
||||
Public Shared Property MasterVolume As Single = 1.0F
|
||||
@ -271,8 +271,8 @@ Public Class MusicManager
|
||||
|
||||
Public Shared Sub UpdateVolume()
|
||||
_lastVolume = Volume * MasterVolume
|
||||
If Not outputDevice Is Nothing Then
|
||||
outputDevice.Volume = Volume * MasterVolume
|
||||
If Not audioFile Is Nothing Then
|
||||
audioFile.Volume = Volume * MasterVolume
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@ -317,13 +317,13 @@ Public Class MusicManager
|
||||
outputDevice.Dispose()
|
||||
End If
|
||||
outputDevice = New WaveOutEvent()
|
||||
audioFile = New VorbisWaveReader(song.Song)
|
||||
audioFile = New NAudio.Wave.WaveChannel32(New VorbisWaveReader(song.Song))
|
||||
_loop = New LoopStream(audioFile, _isLooping)
|
||||
outputDevice.Init(_loop)
|
||||
If Paused = False Then
|
||||
outputDevice.Play()
|
||||
End If
|
||||
outputDevice.Volume = Volume * MasterVolume
|
||||
audioFile.Volume = Volume * MasterVolume
|
||||
_currentSongExists = True
|
||||
_currentSongName = song.Name
|
||||
_currentSong = song
|
||||
|
Loading…
x
Reference in New Issue
Block a user