Add some volume adjustments

nostruct
Stein Ivar Berghei 2022-11-23 23:29:45 +01:00
parent 8667839c44
commit 757275c8f6
2 changed files with 19 additions and 3 deletions

View File

@ -11,6 +11,7 @@ import (
"time"
"github.com/faiface/beep"
"github.com/faiface/beep/effects"
"github.com/faiface/beep/mp3"
"github.com/fhs/gompd/v2/mpd"
"github.com/google/uuid"
@ -168,12 +169,19 @@ func (app *App) ambiancePlay(payload ...interface{}) {
if err != nil {
log.Fatal(err)
}
loop := beep.Loop(-1, play)
volume := &effects.Volume{
Streamer: loop,
Base: 2,
Volume: -2,
Silent: false,
}
discordspeaker.Pause(false)
discordspeaker.Lock()
app.ambiance.Clear()
loop := beep.Loop(-1, play)
app.ambiance.Add(loop)
app.ambiance.Add(volume)
discordspeaker.Unlock()
msg := make(map[string]interface{})

View File

@ -6,6 +6,7 @@ import (
"time"
"github.com/faiface/beep"
"github.com/faiface/beep/effects"
"github.com/kataras/go-events"
"dndmusicbot/ffmpeg"
@ -28,7 +29,14 @@ func init() {
log.Fatal(err)
}
discordspeaker.Play(mpdstream)
volume := &effects.Volume{
Streamer: mpdstream,
Base: 2,
Volume: -2,
Silent: false,
}
discordspeaker.Play(volume)
/*
app.queue = new(Queue)