audio selection works
This commit is contained in:
@@ -3,7 +3,6 @@ package page
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/go-gl/gl/v3.3-core/gl"
|
||||
@@ -261,12 +260,31 @@ func (p *ScrollerPage) Init(ctx *PageCtx) error {
|
||||
}
|
||||
}
|
||||
|
||||
assetsDir := p.Context.CfgPtr.AssetsDir
|
||||
audioFile := filepath.Join(assetsDir, "audio/audio.wav")
|
||||
logger.Info("Attempting to play %s", audioFile)
|
||||
if err := mixer.Play(audioFile, true, p.Context.CfgPtr); err != nil {
|
||||
logger.Error("Mixer returned an error: %v", err)
|
||||
}
|
||||
audioFilePath := p.Context.DbPtr.Find
|
||||
|
||||
// Download if it doesn't exist
|
||||
fmt.Printf("%s", audioFilePath)
|
||||
|
||||
// // Check if the track has previously been downloaded
|
||||
// // TODO: Download audio via a goroutine
|
||||
// // this is a path
|
||||
// // figure out how to get the filename, not the path, from the path.
|
||||
// _, err = os.Stat(audioFilePath)
|
||||
// if err != nil {
|
||||
// filename := filepath.Base(audioFilePath)
|
||||
// url := "https://files.radiantwavetech.com/audio/" + filename
|
||||
// logger.Info("%s not present. Downloading...", entry.DisplayName)
|
||||
// // Download the track if not, display loading bar
|
||||
// if err = netreq.Download(filename, filepath.Join(p.Base.Context.CfgPtr.AssetsDir, "audio"), url); err != nil {
|
||||
// logger.Error("Failed to download file: %v", err)
|
||||
// return
|
||||
// }
|
||||
// logger.Info("Downloaded %s", entry.DisplayName)
|
||||
// }
|
||||
|
||||
// if err := mixer.Play(audioFile, true, p.Context.CfgPtr); err != nil {
|
||||
// logger.Error("Mixer returned an error: %v", err)
|
||||
// }
|
||||
|
||||
currentDevice := mixer.CurrentDevice()
|
||||
if currentDevice == "" {
|
||||
|
||||
Reference in New Issue
Block a user