2019-09-11 02:40:40 -04:00
2019-09-06 01:22:57 -04:00
2019-09-11 02:40:40 -04:00
2019-09-11 02:40:40 -04:00
2019-09-11 03:10:05 -04:00

Voder

Voice things.

Crates to try:

  • hound

    • Encoder/decoder
    • Very mature (3.4.0)
  • cpal

    • Hardware audio out, low level
    • Tons of downloads!
  • wavy

    • Microphone in, speaker out
    • ALSA
  • sample

    • convert between floats, u8s, u16s, etc. via a trait
    • clip amplitude
    • scale playback
    • iterators
    • signal generators (sine, saw, noise, etc.)
  • sonogram

    • generate spectrograms!
    • THEY LOOK SICK!
  • audrey

    • supports range of audio encoders/decoders
    • flac, ogg, wav, alac
  • waveform

    • generate images from wave files
    • con "it is probably threadsafe"
  • samplerate

    • sample rate conversion
  • riff-wave

    • read and write wav files
    • con: old (2016)
  • wavefile

    • con: old (2016)
    • con: low on doc
  • pitch

    • determine pitch and volume of samples
    • uses "bistream autocorrelation function (bcf)"
    • todo: also investigate BACF, uses peaks instead of zero-crossings
  • libwave

    • 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.

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%