use-acoustics 0.1.0

Composable primitive acoustics utilities for Rust.
Documentation
  • Coverage
  • 82.5%
    33 out of 40 items documented1 out of 30 items with examples
  • Size
  • Source code size: 20.13 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 682.99 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 7s Average build duration of successful builds.
  • all releases: 7s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-acoustics
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-acoustics

Composable primitive acoustics utilities for Rust.

use-acoustics provides a small, self-contained v0.1 API for common sound-domain calculations: frequency and period helpers, wavelength conversions, decibel conversions, sound pressure level, sound intensity level, and simple speed of sound approximations.

Relationship To RustUse

use-wave is the broader wave utility set. use-acoustics is the sound-specific sibling that focuses on reusable primitives and small formulas for acoustics-oriented applications.

Warning

The formulas in this crate are general-purpose approximations and convenience conversions. They are not a replacement for specialized acoustic engineering software, calibrated measurements, or standards-driven analysis.

Installation

Crates.io:

[dependencies]
use-acoustics = "0.1"

Local path:

[dependencies]
use-acoustics = { path = "crates/use-acoustics" }

Examples

use use_acoustics::prelude::*;

let wavelength = wavelength_meters(440.0, SPEED_OF_SOUND_AIR_20C_MPS).unwrap();
assert!((wavelength - 0.7795).abs() < 0.001);

let spl = sound_pressure_level_db(1.0).unwrap();
assert!((spl - 93.9794).abs() < 0.001);
use use_acoustics::prelude::*;

let amplitude_ratio = db_to_amplitude_ratio(20.0).unwrap();
let power_ratio = db_to_power_ratio(10.0).unwrap();

assert!((amplitude_ratio - 10.0).abs() < 1.0e-12);
assert!((power_ratio - 10.0).abs() < 1.0e-12);

Module Overview

Module Purpose
decibel Decibel ratios plus SPL and SIL conversions
frequency Frequency newtype, period, and angular frequency helpers
wavelength Frequency and wavelength conversion helpers
pressure Sound pressure newtype and SPL inverse conversion
intensity Sound intensity newtype and SIL inverse conversion
speed Speed of sound helpers
prelude Re-exports for the main public API

Scope

  • decibels and ratios
  • sound pressure level and sound intensity level
  • frequency, period, and angular frequency
  • wavelength conversions
  • speed of sound approximations

Status

Early v0.1 API.