Skip to content

biggeryetbetter/usbd-audio

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

usbd-audio

Crates.io docs.rs

USB Audio 1.0 class for usb-device

This crate provides a USB audio device class based on "Universal Serial Bus Device Class Definition for Audio Devices", Release 1.0 (experimental implementation without the aim of standard compliance).

Since the USB descriptor can be quite large, it may be required to activate the feature control-buffer-256 of the usb-device crate.

Example

let mut usb_bus = ... // create a UsbBusAllocator in a platform specific way
let mut usb_audio = AudioClassBuilder::new()
    .input(
        StreamConfig::new_discrete(
            Format::S16le,
            1,
            &[48000],
            TerminalType::InMicrophone).unwrap())
    .output(
        StreamConfig::new_discrete(
            Format::S24le,
            2,
            &[44100, 48000, 96000],
            TerminalType::OutSpeaker).unwrap())
    .build(&usb_bus)
    .unwrap();

This example creates an audio device having a one channel (Mono) microphone with a fixed sampling frequency of 48 KHz and a two channel (Stereo) speaker output that supports three different sampling rates.

About

Audio 1.0 USB class for usb-device

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%