-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
56 lines (43 loc) · 1.17 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package main
import (
"io"
"log"
"os"
"time"
)
var (
StreamURL = "https://avw.mdr.de/streams/284321-2_mp3_high.m3u"
SongNameURL = "https://www.mdr.de/XML/titellisten/mdr_piraten_2.json" // lol
IsRunning = true
ControlRecording = make(chan bool)
IsRecording = false // has to be here because working with channels is shit
SongStart = ""
SongEnd = ""
Duration = ""
ImageURL = ""
CurrentSong *Song
TimeStartedRecording time.Time
TimeStoppedRecording time.Time
SimilarityThreshold = 0.95
ComparisonSnippetTime = 10 * time.Second
EstimatedRuntime = 8 * time.Hour
CurrentRecordingFilename = ""
targetSampleRate = 44100 // yolo
)
func main() {
logFile, err := os.Create("server.log")
if err != nil {
log.Fatal("Error creating log file:", err)
}
defer logFile.Close()
mw := io.MultiWriter(os.Stdout, logFile)
log.SetOutput(mw)
log.Println("mixscribe")
log.Println("Starting Webserver")
go startWeb()
log.Println("Starting Recorder")
go StartRecording()
log.Println("Starting UpdateInfoLoop")
go UpdateSongInfoLoop()
select {}
}