Add some volume adjustments
parent
8667839c44
commit
757275c8f6
12
events.go
12
events.go
|
@ -11,6 +11,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/faiface/beep"
|
"github.com/faiface/beep"
|
||||||
|
"github.com/faiface/beep/effects"
|
||||||
"github.com/faiface/beep/mp3"
|
"github.com/faiface/beep/mp3"
|
||||||
"github.com/fhs/gompd/v2/mpd"
|
"github.com/fhs/gompd/v2/mpd"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
@ -168,12 +169,19 @@ func (app *App) ambiancePlay(payload ...interface{}) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
loop := beep.Loop(-1, play)
|
||||||
|
|
||||||
|
volume := &effects.Volume{
|
||||||
|
Streamer: loop,
|
||||||
|
Base: 2,
|
||||||
|
Volume: -2,
|
||||||
|
Silent: false,
|
||||||
|
}
|
||||||
|
|
||||||
discordspeaker.Pause(false)
|
discordspeaker.Pause(false)
|
||||||
discordspeaker.Lock()
|
discordspeaker.Lock()
|
||||||
app.ambiance.Clear()
|
app.ambiance.Clear()
|
||||||
loop := beep.Loop(-1, play)
|
app.ambiance.Add(volume)
|
||||||
app.ambiance.Add(loop)
|
|
||||||
discordspeaker.Unlock()
|
discordspeaker.Unlock()
|
||||||
|
|
||||||
msg := make(map[string]interface{})
|
msg := make(map[string]interface{})
|
||||||
|
|
10
queue.go
10
queue.go
|
@ -6,6 +6,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/faiface/beep"
|
"github.com/faiface/beep"
|
||||||
|
"github.com/faiface/beep/effects"
|
||||||
"github.com/kataras/go-events"
|
"github.com/kataras/go-events"
|
||||||
|
|
||||||
"dndmusicbot/ffmpeg"
|
"dndmusicbot/ffmpeg"
|
||||||
|
@ -28,7 +29,14 @@ func init() {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
discordspeaker.Play(mpdstream)
|
volume := &effects.Volume{
|
||||||
|
Streamer: mpdstream,
|
||||||
|
Base: 2,
|
||||||
|
Volume: -2,
|
||||||
|
Silent: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
discordspeaker.Play(volume)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
app.queue = new(Queue)
|
app.queue = new(Queue)
|
||||||
|
|
Loading…
Reference in New Issue