I have the following Dart code:
import 'dart:io';
import 'dart:typed_data';
final data = Uint16List(signal.length);
double value = 0.0;
int normValue = 0;
for (var i = 0; i < signal.length; i++) {
value = signal[i];
normValue = (value * 32767).toInt();
data[i] = normValue;
}
final dataBytes = data.buffer.asUint8List();
How can I reproduce bits of data without using external libraries?
I tried using web_audio and HTML, but there was a platform compatibility error.
New contributor
Daniel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.