What's in a ring buffer? And using them in Rust
ntietz.com
ntietz.com
Unless I'm missing something, the implementation using `push` would also be possible to mimic via the current stable public API of `Vec`, it might take 50 lines of code[1] to define a wrapper type with this method, so I'm with that this isn't something that I'd pull in a dependency for.
[1]: If anyone reading this wants one to steal, feel free to grab one I threw together here https://play.rust-lang.org/?version=stable&mode=debug&editio...
Half-transfer means when 1/2 of the DMA transfer size is done, an interrupt fires. So, you can use this and full-transfer interrupts to manage the sequencing.
Interestingly, while the core part of the audio process is in rust (through WASM), the ring buffer itself is written in JS land (shared array buffer so that the audio context can read from it).
it always takes me a few seconds (well, more than a few actually) to work out that in that case, the buffer is just full (like every other buffer).