Documentation ¶
Index ¶
- type Options
- type Trx
- func (x *Trx) AddServer(asvr *proxy.AudioServer)
- func (x *Trx) RemoveServer(asName string) error
- func (x *Trx) RxState() (bool, error)
- func (x *Trx) RxVolume() (float32, error)
- func (x *Trx) SelectServer(name string) error
- func (x *Trx) SelectedServer() string
- func (x *Trx) Server(name string) (*proxy.AudioServer, bool)
- func (x *Trx) Servers() []string
- func (x *Trx) SetNotifyServerChangeCb(f func())
- func (x *Trx) SetPTT(pttState bool) error
- func (x *Trx) SetRxState(on bool) error
- func (x *Trx) SetRxVolume(vol float32) error
- func (x *Trx) SetTxVolume(vol float32) error
- func (x *Trx) SetVOX(voxState bool) error
- func (x *Trx) SetVOXEnabled(enable bool)
- func (x *Trx) SetVOXHoldTime(t time.Duration)
- func (x *Trx) SetVOXThreshold(v float32)
- func (x *Trx) TxState() (bool, error)
- func (x *Trx) TxUser() (string, error)
- func (x *Trx) TxVolume() (float32, error)
- func (x *Trx) VOX() bool
- func (x *Trx) VOXEnabled() bool
- func (x *Trx) VOXHoldTime() time.Duration
- func (x *Trx) VOXThreshold() float32
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { Rx *chain.Chain Tx *chain.Chain FromNetwork *pbReader.PbReader ToNetwork *pbWriter.PbWriter Broker broker.Broker Vox *vox.Vox }
Options is the data structure holding the values used for instantiating a Trx object. This struct has to be provided the the object constructor.
type Trx ¶
Trx is a data structure which holds the components needed for a 2-way radio. It holds the available audio servers, the communication means, the audio rx and tx chains etc.
func (*Trx) AddServer ¶
func (x *Trx) AddServer(asvr *proxy.AudioServer)
AddServer adds a remote audio server, represented through a proxy object.
func (*Trx) RemoveServer ¶
RemoveServer removes a remote audio server from the Trx.
func (*Trx) RxState ¶
RxState returns a boolean if the remote audio server is streaming audio or not.
func (*Trx) SelectServer ¶
SelectServer selects a particular remote audio server from which the audio will be received / sent to.
func (*Trx) SelectedServer ¶
SelectedServer returns the name of the currently selected Audio Server.
func (*Trx) Server ¶
func (x *Trx) Server(name string) (*proxy.AudioServer, bool)
Server returns a particular AudioServer. If no AudioServer exists with that name, (nil, false) will be returned.
func (*Trx) SetNotifyServerChangeCb ¶
func (x *Trx) SetNotifyServerChangeCb(f func())
SetNotifyServerChangeCb allows to set a callback which get's executed when a remote audio server changes / disappears.
func (*Trx) SetPTT ¶
SetPTT (Push To Talk) turns on/off the audio stream sent to the remote audio server. In case VOX is active, the application will continue streaming audio to the server.
func (*Trx) SetRxState ¶
SetRxState turns on/off the audio stream sent from the remote audio server.
func (*Trx) SetRxVolume ¶
SetRxVolume sets the volume of the local speakers.
func (*Trx) SetTxVolume ¶
SetTxVolume sets the volume of the audio sent to the remote audio server.
func (*Trx) SetVOXEnabled ¶
SetVOXEnabled enables the vox in the tx chain
func (*Trx) SetVOXHoldTime ¶
SetVOXHoldTime sets the vox hold time
func (*Trx) SetVOXThreshold ¶
SetVOXThreshold sets the vox threshold level
func (*Trx) TxState ¶
TxState returns a boolean if audio is currently sent to the remote audio server, or not.
func (*Trx) TxUser ¶
TxUser returns the current user from which the remote audio server is receiving audio. If nobody is transmitting / sending audio to the remote audio server, an empty string will be returned.
func (*Trx) TxVolume ¶
TxVolume returns the current volume level for the audio sent to the remote audio server.
func (*Trx) VOXHoldTime ¶
VOXHoldTime returns the vox hold time
func (*Trx) VOXThreshold ¶
VOXThreshold returns the vox threshold level