Open tone-test output before transmission
This commit is contained in:
committed by
Brandon McGinty
parent
d64e5125dd
commit
e564bb8583
@@ -56,12 +56,8 @@ func (b *Barnard) connect(reconnect bool) bool {
|
||||
// --- Tone test mode: skip all OpenAL; generate 440 Hz tone
|
||||
// --- and save incoming audio to a file.
|
||||
|
||||
// Start the tone generator goroutine.
|
||||
b.toneTestStop = make(chan struct{})
|
||||
go StartToneGenerator(b.Client, b.toneTestStop)
|
||||
b.Tx = true
|
||||
|
||||
// Attach the audio file saver.
|
||||
// Open the output first. Starting transmission before this succeeds
|
||||
// leaves an orphaned tone goroutine when the path is unusable.
|
||||
saver, err := NewAudioFileSaver(b.ToneTestOutput)
|
||||
if err != nil {
|
||||
b.exitWithError(err)
|
||||
@@ -70,6 +66,10 @@ func (b *Barnard) connect(reconnect bool) bool {
|
||||
b.toneTestSaver = saver
|
||||
b.Client.Config.AttachAudio(saver)
|
||||
|
||||
b.toneTestStop = make(chan struct{})
|
||||
go StartToneGenerator(b.Client, b.toneTestStop)
|
||||
b.Tx = true
|
||||
|
||||
b.Connected = true
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user