alsa

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Examples

Constants

View Source
const (
	StandardSubformat  SubformatType = iota
	SubformatTypeFirst               = StandardSubformat
	SubformatTypeLast                = StandardSubformat
)
View Source
const (
	Unknown sampleFormat = -1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Access

type Access int
const (
	MmapInterleaved Access = iota
	MmapNonInterleaved
	MmapComplex
	RWInterleaved
	RWNonInterleaved
	AccessTypeLast  = RWNonInterleaved
	AccessTypeFirst = MmapInterleaved
)

func (Access) String

func (a Access) String() string

type Card

type Card struct {
	Path    string
	ID      string
	Name    string
	Driver  string
	Index   int
	Version Version
	// contains filtered or unexported fields
}

func List

func List() ([]*Card, error)

List all available cards.

func Open

func Open(index int) (*Card, error)

Open a handle to a card by number.

Example
card, err := Open(0)
if err != nil {
	panic("error opening card 0: " + err.Error())
}
println("opened card ", card)

func OpenDriver

func OpenDriver(name string) (*Card, error)

OpenDriver opens a handle to a card by driver name.

Example
card, err := OpenDriver("snd_bcm2835")
if err != nil {
	panic("error opening snd_bcm2835: " + err.Error())
}
println("opened card ", card)

func (*Card) Close

func (card *Card) Close() error

func (*Card) Devices

func (card *Card) Devices() ([]*Device, error)

type Device

type Device struct {
	Type      DeviceType
	Index     int
	Path      string
	Name      string
	CanPlay   bool
	CanRecord bool
	// contains filtered or unexported fields
}

func (*Device) BufferFormat

func (dev *Device) BufferFormat() (audio.Format, error)

func (*Device) Close

func (dev *Device) Close() error

func (*Device) Open

func (dev *Device) Open() error

func (*Device) Read

func (dev *Device) Read(p []byte) (n int, err error)

func (Device) String

func (dev Device) String() string

func (*Device) Write

func (dev *Device) Write(p []byte) (n int, err error)

type DeviceType

type DeviceType int
const (
	UnknownDeviceType DeviceType = iota
	PCM
)

func (DeviceType) String

func (t DeviceType) String() string

type Flags

type Flags uint32
const (
	OpenMin Flags = 1 << iota
	OpenMax
	Integer
	Empty
)

func (Flags) String

func (f Flags) String() string

type SubformatType

type SubformatType int

func (SubformatType) String

func (f SubformatType) String() string

type Timespec

type Timespec struct {
	Sec  int
	Nsec int
}

type Version

type Version uint32

func (Version) Major

func (v Version) Major() int

func (Version) Minor

func (v Version) Minor() int

func (Version) Patch

func (v Version) Patch() int

func (Version) String

func (v Version) String() string

Jump to

Keyboard shortcuts

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