mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-02 16:38:14 +00:00
9482fb230248f6af2ffca35deb272c602a57ad46
Voder
Voice things.
Crates to try:
-
- Encoder/decoder
- Very mature (3.4.0)
-
- Hardware audio out, low level
- Tons of downloads!
-
- Microphone in, speaker out
- ALSA
-
- convert between floats, u8s, u16s, etc. via a trait
- clip amplitude
- scale playback
- iterators
- signal generators (sine, saw, noise, etc.)
-
- generate spectrograms!
- THEY LOOK SICK!
-
- supports range of audio encoders/decoders
- flac, ogg, wav, alac
-
- generate images from wave files
- con "it is probably threadsafe"
-
- sample rate conversion
-
- read and write wav files
- con: old (2016)
-
- con: old (2016)
- con: low on doc
-
- determine pitch and volume of samples
- uses "bistream autocorrelation function (bcf)"
- todo: also investigate BACF, uses peaks instead of zero-crossings
-
- wav library, based on nom zero-copy parser
- PCM support
- 18/16/32/64 bit support
Hardware
Enumerate hardware:
pactl list short sinks
The linux headphone jack is named at startup:
speaker-test -t wav -c 6 -D front
To change the 'default' speaker,
pactl list short sinks
pactl set-default-sink 'alsa_output.pci-0000_00_1f.3.analog-stereo'
speaker-test -t wav -c 6 -D default
This makes the rust code work on Desktop.
Links
Troubleshooting
THIS WORKS TO DEFEAT CHIPMUNK NOISES!
device.serial = "Focusrite_Scarlett_2i4_USB"
device.string = "surround40:1"
device.buffering.buffer_size = "1048576"
device.buffering.fragment_size = "524288"
PulseAudio's default sampling rate and bit depth are set to 44100Hz @ 16 bits.
1048576 / 1411200 (buffer size) 0.7430385487528345 = 743 ms 524288 / 1411200 (fragment size) 0.37151927437641724 = 372 ms
Languages
Rust
59.4%
TypeScript
39.3%
JavaScript
0.7%
Python
0.3%
CSS
0.2%
Other
0.1%