emitTone method
Publishes count frames at a steady amplitude from 0 to 1.
The usual way to make a fake visualizer show something.
Implementation
void emitTone(int count, {double amplitude = 0.5}) {
final peak = (amplitude.clamp(0.0, 1.0) * 32767).round();
for (var i = 0; i < count; i++) {
emit((min: -peak, max: peak, rms: (peak * 0.707).round()));
}
}