GoAlsa

module
v0.0.0-...-75e09c4 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: Apache-2.0

README ¶

GoAlsa 🎵

Go bindings for ALSA

Installation 🚀

Make sure you have the development headers installed:

Debian/Ubuntu
$ sudo apt install libasound2-dev -y
Arch
$ sudo pacman -S alsa-lib -y
Fedora
$ sudo dnf install alsa-lib-devel -y
Now install the go package:
$ go get -u github.com/Binozo/GoAlsa

Quickstart 💫

package main

import (
	"github.com/Binozo/GoAlsa/pkg/alsa"
)

func main() {
	//hw:<CARD_NR>,<DEVICE_NR>
	device, err := alsa.NewPlaybackDevice("hw:0,0", alsa.Config{
		Channels:   2,
		Format:     alsa.FormatS16LE,
		SampleRate: 48000,
	})
	if err != nil {
		panic(err)
	}
	defer device.Close()
}

Directories ¶

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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