alsa

package module
v0.0.0-...-b24655b Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

README

go-alsa

A pure Go audio binding to ALSA that supports audio playback.

Build Status Go Report Card GoDoc

WARNING

The public API is unstable. Please fork/vendor before using. Right now it's inspired by oto, but only the player part is implemented, and some features are missing that alsa-lib might do to make it plug-and-play:

  • format conversion
  • channel conversion
  • resampling

TODO

This library implements the bare minimum of the rich alsa API. What's missing:

  • hardware feature detection (sample rate, channels, formats)
  • capture
  • non-interleaved audio playback
  • mmap-based API (less copying)
  • others

Documentation

Overview

oto-compatible (mostly) CGO-less alsa library

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Player

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

func NewPlayer

func NewPlayer(sampleRate, channelNum, bytesPerSample, bufferSizeInBytes int) (*Player, error)

func NewPlayerWithDevice

func NewPlayerWithDevice(sampleRate, bufferSizeInBytes int, device string) (*Player, error)

func (*Player) Close

func (p *Player) Close() error

func (*Player) Write

func (p *Player) Write(data []byte) (int, error)

Jump to

Keyboard shortcuts

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