Skip to content

Binozo/GoAlsa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()
}

Releases

No releases published

Packages

No packages published

Languages