Fix audio bug
This commit is contained in:
@@ -301,14 +301,14 @@ func (p *ScrollerPage) Init(ctx *PageCtx) error {
|
||||
}
|
||||
|
||||
// Start audio playback
|
||||
selectedAudio := p.Base.Context.CfgPtr.SelectedAudio
|
||||
|
||||
// selectedAudio := p.Base.Context.CfgPtr.SelectedAudio
|
||||
|
||||
assetsDir := p.Base.Context.CfgPtr.AssetsDir
|
||||
|
||||
if selectedAudio == "" {
|
||||
} else {
|
||||
if err := mixer.Play(filepath.Join(assetsDir, selectedAudio), true, p.Base.Context.CfgPtr); err != nil {
|
||||
}
|
||||
audioFile := filepath.Join(assetsDir, "audio/audio.wav")
|
||||
logger.Info("Attempting to play %s", audioFile)
|
||||
if err := mixer.Play(audioFile, true, p.Base.Context.CfgPtr); err != nil {
|
||||
logger.Error("Mixer returned an error: %v", err) // ADD THIS
|
||||
}
|
||||
|
||||
currentDevice := mixer.CurrentDevice()
|
||||
|
||||
Reference in New Issue
Block a user