dtmf

Crates.iodtmf
lib.rsdtmf
version0.1.5
sourcesrc
created_at2022-01-30 21:26:06.926664
updated_at2022-11-04 19:26:39.074307
descriptionA no-std DTMF decoder
homepage
repositoryhttps://gitlab.scd31.com/stephen/dtmf
max_upload_size
id524199
size48,310
Stephen D (scd31)

documentation

README

dtmf

A no-std DTMF decoder for Rust. Can be used on a microcontroller or on a normal PC.

Usage

// Load in our audio samples
// This can also be done in real time from the sound card
let mut sample_file = File::open("data/dtmf_test.wav").unwrap();
let (header, data) = wav::read(&mut sample_file).unwrap();
let data = data.try_into_sixteen().unwrap();

// set up our decoder
let mut decoder = Decoder::new(header.sampling_rate, |tone, state| {
	println!("{:?}: {:?}", tone, state);
});

// can process all samples at once, or in smaller batches
decoder.process(&data);
Commit count: 0

cargo fmt