Documentation
¶
Overview ¶
Package portaudio provides Go bindings for PortAudio.
By default the C sources are compiled directly from the vendored pa_src submodule (see portaudio_vendored*.go). Build with -tags portaudio_system to link against a system libportaudio via pkg-config instead (portaudio_system.go); the Homebrew formula uses this so it depends on the brew `portaudio` formula rather than the vendored copy. The Go API below is identical either way.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Initialize ¶
func Initialize() error
Initialize must be called before any other portaudio function.
Types ¶
type DeviceInfo ¶
type DeviceInfo struct {
Index int
Name string
MaxInputChannels int
MaxOutputChannels int
DefaultSampleRate float64
IsDefaultInput bool
IsDefaultOutput bool
InputLatency time.Duration
OutputLatency time.Duration
}
func DefaultInputDevice ¶
func DefaultInputDevice() (*DeviceInfo, error)
func DefaultOutputDevice ¶
func DefaultOutputDevice() (*DeviceInfo, error)
func FindDevice ¶
func FindDevice(query string, input bool) (*DeviceInfo, error)
FindDevice finds a device by index (numeric string) or name substring (case-insensitive).
func ListDevices ¶
func ListDevices() ([]DeviceInfo, error)
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
func OpenInputStream ¶
func OpenInputStream(device *DeviceInfo, sampleRate, channels, framesPerBuffer int) (*Stream, error)
func OpenOutputStream ¶
func OpenOutputStream(device *DeviceInfo, sampleRate, channels, framesPerBuffer int) (*Stream, error)
func (*Stream) Info ¶
func (s *Stream) Info() StreamInfo
Click to show internal directories.
Click to hide internal directories.