9 releases

0.2.8 May 21, 2024
0.2.7 Jan 17, 2023
0.2.5 Sep 4, 2022
0.2.4 Aug 29, 2022
0.1.0-alpha.1 Dec 23, 2020

#73 in Audio

Download history 511/week @ 2024-06-30 818/week @ 2024-07-07 1618/week @ 2024-07-14 1489/week @ 2024-07-21 1253/week @ 2024-07-28 1319/week @ 2024-08-04 2081/week @ 2024-08-11 1343/week @ 2024-08-18 1529/week @ 2024-08-25 1488/week @ 2024-09-01 1404/week @ 2024-09-08 1281/week @ 2024-09-15 1554/week @ 2024-09-22 1236/week @ 2024-09-29 321/week @ 2024-10-06 1027/week @ 2024-10-13

4,284 downloads per month
Used in 5 crates (3 directly)

MIT/Apache

1MB
2.5K SLoC

quad-snd

High-level, light-weight, and opinionated audio library.

  • Web: WebAudio
  • Android: OpenSLES
  • Linux: Alsa
  • macOS: CoreAudio
  • Windows: Wasapi
  • iOS: CoreAudio

Being high-level enough allows quad-snd to use very different approaches to each backend. For example, for WebAudio all the playback and mixing is based on Audio nodes, while in OpenSLES quad-snd itself is responsible for mixing.

quad-snd lacks lots of features and the best way to use the library - either fork a repo and fine-tune it for your needs or just copy-paste some code from certain audio backends.

Biggest difference from any other sound library in rust:
quad-snd is small. Each backend implementation is ~300LoC code and is self sufficient - you can copy-paste the whole thing and run it, (almost)no common code, dependencies or anything like that would be required.

The only dependency is audrey. audrey helps backends that do not have file parsing functionality (all the platforms but web) to get bytes out of encoded .wav/.ogg. When web is not required - getting rid of audrey and use anything else(or nothing at all) for audio decoding is a super easy fix.

Attribution

While building quad-snd I looked into the implementation of the following libraries:

https://github.com/floooh/sokol/blob/master/sokol_audio.h
https://github.com/norse-rs/audir
https://github.com/unrust/uni-snd

Dependencies