Code Monkey home page Code Monkey logo

alsa-rs's Introduction

Thin but safe wrappers for ALSA.

API Documentation

Crates.io

Expect the following to work:

  • Audio Playback

  • Audio Recording

  • Mixer controls

  • HCtl API (for jack detection)

  • Raw midi

  • Midi sequencer API (most of it)

  • Enumerations of all of the above

  • Poll and/or wait for all of the above

The following is not yet implemented (mostly because nobody asked for them) :

  • Separate timer API (snd_timer_*)

  • Config API (snd_config_*)

  • Plug-in API

Quickstart guide / API design:

  • Most functions map 1-to-1 to alsa-lib functions, e g, ctl::CardInfo::get_id() is a wrapper around snd_ctl_card_info_get_id and the alsa-lib documentation can be consulted for additional information.

  • Structs are RAII and closed/freed on drop, e g, when a PCM struct is dropped, snd_pcm_close is called.

  • To read and write buffers, call the io_* methods. It will return a separate struct from which you can read or write, and which can also be used for mmap (if supported by the driver).

  • Error handling - most alsa-lib functions can return errors, so the return value from these is a Result.

  • Enumeration of cards, devices etc is done through structs implementing Iterator.

  • Many structs implement Polldescriptors, to combine with poll or mio. (Or just use wait if you don't need that functionality.)

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.