feat(icom): phase 5 — the voice keyer plays to the radio over the LAN
The audio session opens its TX side alongside RX (txenable in the conninfo, 16 kHz both ways), the stream gains a paced sender — 320 samples every 20 ms, the frame mirroring what the rig itself sends on this socket, IDs swapped — and the network Icom takes the same NetworkPlayer slot a TCI radio does: pick 'Radio (network audio)' as the To-radio device and the voice keyer needs no cable and no virtual sound card. PTT brackets the message through the same code as every other audio path.
This commit is contained in:
@@ -2047,3 +2047,20 @@ func agcValue(name string) byte {
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// PlayTXAudio hands a voice-keyer message to the network audio session, when
|
||||
// this rig is reached over one. A USB-connected Icom takes its audio through
|
||||
// its own sound card instead, and says so.
|
||||
func (b *IcomSerial) PlayTXAudio(pcm []byte, rate, ch, bits int, stop <-chan struct{}) error {
|
||||
// port is written once per Connect, on the CAT goroutine this is fetched
|
||||
// from (IcomDo); at worst a reconnect leaves this one connection stale, and
|
||||
// a stale transport fails fast on its closed done channel.
|
||||
port := b.port
|
||||
type txPlayer interface {
|
||||
PlayTXAudio(pcm []byte, rate, ch, bits int, stop <-chan struct{}) error
|
||||
}
|
||||
if p, ok := port.(txPlayer); ok {
|
||||
return p.PlayTXAudio(pcm, rate, ch, bits, stop)
|
||||
}
|
||||
return fmt.Errorf("this rig takes transmit audio through its USB sound card, not the CAT link")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user