2022-11-18 21:18:12 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
|
2023-10-26 20:49:39 +00:00
|
|
|
"github.com/gopxl/beep"
|
|
|
|
"github.com/gopxl/beep/effects"
|
2022-11-18 21:18:12 +00:00
|
|
|
|
|
|
|
discordspeaker "dndmusicbot/speaker"
|
|
|
|
)
|
|
|
|
|
2022-12-03 18:22:05 +00:00
|
|
|
var pl_volume *effects.Volume
|
|
|
|
var amb_volume *effects.Volume
|
|
|
|
|
2022-11-18 21:18:12 +00:00
|
|
|
func init() {
|
2023-10-26 20:49:39 +00:00
|
|
|
log.Println("beep.go loading..")
|
2022-11-23 07:37:59 +00:00
|
|
|
|
2022-11-19 16:37:49 +00:00
|
|
|
app.ambiance = beep.Mixer{}
|
2022-12-03 18:22:05 +00:00
|
|
|
|
|
|
|
amb_volume = &effects.Volume{
|
|
|
|
Streamer: &app.ambiance,
|
|
|
|
Base: 2,
|
|
|
|
Volume: 2,
|
|
|
|
Silent: false,
|
|
|
|
}
|
|
|
|
discordspeaker.Play(amb_volume)
|
2022-11-18 21:18:12 +00:00
|
|
|
|
2022-11-23 07:37:59 +00:00
|
|
|
mpdstream, err := NewMPD()
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2022-12-03 18:22:05 +00:00
|
|
|
pl_volume = &effects.Volume{
|
2022-11-23 22:29:45 +00:00
|
|
|
Streamer: mpdstream,
|
|
|
|
Base: 2,
|
|
|
|
Volume: -2,
|
|
|
|
Silent: false,
|
|
|
|
}
|
|
|
|
|
2022-12-03 18:22:05 +00:00
|
|
|
discordspeaker.Play(pl_volume)
|
2022-11-23 07:37:59 +00:00
|
|
|
|
2023-10-26 20:49:39 +00:00
|
|
|
log.Println("beep.go done.")
|
2022-11-18 21:18:12 +00:00
|
|
|
}
|