mirror of https://github.com/jetkvm/kvm.git
34 lines
599 B
Go
34 lines
599 B
Go
package audio
|
|
|
|
const (
|
|
ipcMsgTypeOpus = 0
|
|
)
|
|
|
|
type AudioConfig struct {
|
|
Bitrate uint16
|
|
Complexity uint8
|
|
BufferPeriods uint8
|
|
DTXEnabled bool
|
|
FECEnabled bool
|
|
PacketLossPerc uint8
|
|
}
|
|
|
|
func DefaultAudioConfig() AudioConfig {
|
|
return AudioConfig{
|
|
Bitrate: 192,
|
|
Complexity: 8,
|
|
BufferPeriods: 12,
|
|
DTXEnabled: true,
|
|
FECEnabled: true,
|
|
PacketLossPerc: 0,
|
|
}
|
|
}
|
|
|
|
type AudioSource interface {
|
|
ReadMessage() (msgType uint8, payload []byte, err error)
|
|
WriteMessage(msgType uint8, payload []byte) error
|
|
IsConnected() bool
|
|
Connect() error
|
|
Disconnect()
|
|
}
|