portaudio

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2019 License: MIT Imports: 3 Imported by: 0

README

Portaudio

GoDoc Go Report Card Build Status codecov

Play audio with portaudio API.

Documentation

Overview

Package portaudio allows to play audio with Portaudio API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Devices

func Devices() (map[IO][]Device, error)

Devices return a list of portaudio devices.

Types

type Device

type Device struct {
	// contains filtered or unexported fields
}

Device is the device accessed through portaudio.

func DefaultInputDevice

func DefaultInputDevice() (d Device, err error)

DefaultInputDevice returns input device used by system as default at the moment.

func DefaultOutputDevice

func DefaultOutputDevice() (d Device, err error)

DefaultOutputDevice returns output device used by system as default at the moment.

type IO

type IO int

IO determines the type of device.

const (
	// Input is a device that has input channels.
	Input IO = iota
	// Output is a device that has output channels.
	Output
	// Inactive is a device that doesn't have any input or output channels.
	Inactive
)

func (IO) String

func (i IO) String() string

type Sink

type Sink struct {
	Device
	// contains filtered or unexported fields
}

Sink represets portaudio sink which allows to play audio. If no device is provided, the current system default will be used.

func (*Sink) Flush

func (s *Sink) Flush(string) (err error)

Flush terminates portaudio structures. It's executed only if Reset didn't return error.

func (*Sink) Reset

func (s *Sink) Reset(string) error

Reset sink to use valid portaudio device info.

func (*Sink) Sink

func (s *Sink) Sink(sourceID string, sampleRate signal.SampleRate, numChannels int) (func(signal.Float64) error, error)

Sink writes the buffer of data to portaudio stream. It aslo initilizes a portaudio api with default stream.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL