updateWavefromData method
Updates and returns the current waveform (time-domain) data.
This method populates the _waveformData
list with the latest audio data.
Returns the updated _waveformData
.
Implementation
Uint8List updateWavefromData() {
if (_analyserNode != null) {
try {
_analyserNode!.getByteTimeDomainData(_waveformData.toJS);
} catch (e) {
_waveformData.fillRange(0, _waveformData.length, 128);
}
} else {
_waveformData.fillRange(0, _waveformData.length, 128);
}
return _waveformData;
}