fix: volume gets stuck
This commit is contained in:
1 parent
2ab22eea85
commit
8d57412eff
2 files changed
+7
-7
No files matched your search
@@ -9,14 +9,14 @@ import Track from './Track.js'
|
||||
|
||||
dotenv.config()
|
||||
|
||||
const defaultVolume = parseInt(process.env.VOLUME_DEFAULT),
|
||||
offset = Number(process.env.OFFSET),
|
||||
verbose = Number(process.env.VERBOSE)
|
||||
const defaultVolume = parseInt(process.env.VOLUME_DEFAULT ?? 100),
|
||||
offset = Number(process.env.OFFSET ?? 0),
|
||||
verbose = Number(process.env.VERBOSE ?? 0)
|
||||
|
||||
function play(track) {
|
||||
queueCommand('volume', [defaultVolume])
|
||||
queueCommand('change', [track.url])
|
||||
player.play()
|
||||
queueCommand('volume', [defaultVolume])
|
||||
updateStatus(track.tid, 0, track.duration, false)
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -29,8 +29,8 @@ def pause(args):
|
||||
def volume(args):
|
||||
vol, *args = args
|
||||
|
||||
player.audio_set_volume(vol)
|
||||
info('volume', ['set', vol])
|
||||
result = player.audio_set_volume(vol)
|
||||
info('volume', ['set', vol, result])
|
||||
|
||||
|
||||
def fadeOut(args):
|
||||
@@ -42,7 +42,7 @@ def fadeOut(args):
|
||||
player.audio_set_volume(v)
|
||||
sleep(duration / vol)
|
||||
|
||||
stop()
|
||||
pause([])
|
||||
info('fadeOut', ['done'])
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user