Git Product home page Git Product logo

alsa's Introduction

Synopsis

This is a golang ALSA client implementation, without cgo! Unfortunately, doing it without cgo means throwing away many years of compatibility work that has been put into libalsa. So be warned, this library is not likely to work with a lot of the more colorful audio cards out there, and is not likely to work on platforms other than x86_64. (Though, someone has nicely done some work on ARM. Thanks!)

But fear not! Go is fun, and I tried to keep the library on the simple side, so adding in support for what your audio card needs might actually be just a nice afternoon of programming. The hardest part for me was just trying to understand all of the alsa terminology.

For a simple example of synthesized playback, the beep command will produce a sine wave for a few seconds on each detected ALSA output:

go get github.com/yobert/alsa/cmd/beep
$GOPATH/beep

And for recording from a microphone into a WAV file:

go get github.com/yobert/alsa/cmd/record
$GOPATH/record

This example does recording and playback, but it's got a really buggy ring buffer going on:

go get github.com/yobert/alsa/cmd/echoback
$GOPATH/echoback

Disclaimer

This module makes syscalls with pointers to memory buffers that are in garbage collectable memory. I have a feeling this isn't safe, but it hasn't crashed on me yet.

Contributors

Thanks so much for the help! Thanks! See AUTHORS for a list. Pull requests welcome from anybody, regardless of skill level.

See Also

You may be interested in https://github.com/jfreymuth/pulse which is a lot less likely to crash and will probably work with your sound card.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.