Commit df10c131 authored by Trevor Slocum's avatar Trevor Slocum

Do not initialize speaker when streaming to fd

parent 6c70ef3f
Pipeline #111802766 passed with stage
in 1 minute and 7 seconds
......@@ -111,14 +111,16 @@ func play(audioFile *audioFile) {
}
}
if audioFile.Format.SampleRate != playingSampleRate {
err := speaker.Init(audioFile.Format.SampleRate, audioFile.Format.SampleRate.N(bufferSize))
if err != nil {
log.Fatalf("failed to initialize audio device: %s", err)
if streamFdInt == -1 {
if audioFile.Format.SampleRate != playingSampleRate {
err := speaker.Init(audioFile.Format.SampleRate, audioFile.Format.SampleRate.N(bufferSize))
if err != nil {
log.Fatalf("failed to initialize audio device: %s", err)
}
playingSampleRate = audioFile.Format.SampleRate
} else {
speaker.Clear()
}
playingSampleRate = audioFile.Format.SampleRate
} else {
speaker.Clear()
}
streamer := beep.Seq(audioFile.Streamer, beep.Callback(func() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment