feat: detect OS and use the ffmpeg exe name
This commit is contained in:
parent
f3cf682b38
commit
56cc38144d
1 changed files with 8 additions and 2 deletions
10
main.go
10
main.go
|
@ -46,6 +46,7 @@ import (
|
|||
"net/url"
|
||||
"os"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
|
@ -283,10 +284,15 @@ func loadImageURL(url string) image.Image {
|
|||
}
|
||||
|
||||
func main() {
|
||||
RADIOSPIRAL_STREAM := "https://radiospiral.radio/stream.mp3"
|
||||
RADIOSPIRAL_JSON_ENDPOINT := "https://radiospiral.net/wp-json/radio/broadcast"
|
||||
const RADIOSPIRAL_STREAM = "https://radiospiral.radio/stream.mp3"
|
||||
const RADIOSPIRAL_JSON_ENDPOINT = "https://radiospiral.net/wp-json/radio/broadcast"
|
||||
PLAYER_CMD := "ffmpeg"
|
||||
|
||||
if runtime.GOOS == "windows" {
|
||||
log.Println("Detected Windows")
|
||||
PLAYER_CMD = "ffmpeg.exe"
|
||||
}
|
||||
|
||||
// Command line arguments parsing
|
||||
loggingToFilePtr := flag.Bool("log", false, "Create a log file")
|
||||
|
||||
|
|
Loading…
Reference in a new issue