encode method
Encodes the audio format to a Uint8List.
Implementation
Uint8List encode() {
final ByteData data = ByteData(32);
data.setFloat64(0, sampleRate);
data.buffer.asUint8List().setRange(8, 12, formatID.encode());
data.setInt32(12, formatFlags);
data.setInt32(16, bytesPerPacket);
data.setInt32(20, framesPerPacket);
data.setInt32(24, channelsPerPacket);
data.setInt32(28, bitsPerChannel);
return data.buffer.asUint8List();
}