Documentation ¶
Overview ¶
Package audio contains a buffer for streaming audio from a desktop to and from a websocket client. It is used by the kvdi-proxy to provide playback and microphone support.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer provides a ReadWriteCloser for proxying audio data to and from a websocket connection. The read-buffer is populated with opus/webm data and writes to write-buffer can be in any format that gstreamer `decodebin` supports.
type BufferOpts ¶
type BufferOpts struct { // A Logger to log messages to, one will be created if this is nil. Logger logr.Logger // The path to the PulseAudio UNIX socket. The default server is selected // if omitted. PulseServer string // The format to use when streaming and writing to the pulse server. // Defaults to `S16LE` (signed 16-bit little-endian). PulseFormat string // The name of the device to monitor for playback on the read-buffer. // The default device is selected when this omitted. PulseMonitorName string // The sample rate to use on the playback monitor. Defaults to 24000. PulseMonitorSampleRate int // The number of channels to record on the playback monitor. Defaults to 2. PulseMonitorChannels int // The name of the PulseSource to write to when recording on the write-buffer. // This is required because an additional monitor needs to be created on the // mic device to allow PulseAudio to flush its buffers. Defaults to "virtmic". PulseMicName string // The path of the PulseAudio FIFO to write to when recording on the write-buffer. // Defaults to /var/run/kvdi/mic.fifo. PulseMicPath string // The sample rate of the pulse mic. Defaults to 16000. PulseMicSampleRate int // The number of channels on the mic. Defaults to 1. PulseMicChannels int }
BufferOpts represents options passed to NewBuffer when building a recording or playback pipeline. Sane defaults are provided for every field, but may not be suitable for all use cases.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.