Crate buplib

Source
Expand description

§🔘 BUP

A small beeper / buzzer socket wrapper library

§Introduction

BUP is a wrapper for socket-like structs (Unix, UDP, TCP…) that beeps at every connection using a provided Source to generate the samples from using the result of the connection (a stream, some bytes…).

§Example

This crate comes with an example and some comments. It creates a BUP with an infinite sinewave source and sends increasing values to it via a Unix socket.

To run it, use cargo :

cargo run --example sine

§Q&A

§Is BUP an acronym?

Almost.

§Rodio says “NoDevice”

You probably dropped your OutputStream.

§Is this the future?

Not yet.

Structs§

Bup
Main struct with a receiver and an audio output handle.

Traits§

AudioPlayer
Supports playing audio.
Buzzer
Classic Buzzer, able to generate samples out of a Receiver’s return value. To keep some information between beeps, use StateBuzzer.
Receiver
A structure, usually a socket, which can accept connexions (blocking) and return something out of it. Impls are available for common socket types.
StateBuzzer
Buzzer with a state! Implement this on a struct to save information between beeps.