Closed shingohu closed 2 weeks ago
PcmArrayInt16.fromList(List<int> list)
expects integer range 0-65536
you probably are passing 0-255 range integers.
you can try PcmArrayInt16({required this.bytes});
instead.
PcmArrayInt16
Sorry, I'm not quite sure how to convert Uint8list to ByteData, and I can't play it properly using the following methods
FlutterPcmSound.feed(PcmArrayInt16(bytes: ByteData.view(data.buffer)));
Uint8List uint8List = Uint8List.fromList([1, 2, 3, 4]); // Example data
ByteData byteData = uint8List.buffer.asByteData();
Uint8List uint8List = Uint8List.fromList([1, 2, 3, 4]); // Example data ByteData byteData = uint8List.buffer.asByteData();
I have tried this method before, but it did not work
Can you provide a feed method that directly passes Uint8List
no. because uint8list does not specify which endianness it is.
does the example work? start with the example, and debug why it works and yours does not.
print the bytes.
不,因为 uint8list 没有指定它是哪种字节顺序。
这个例子能工作吗?从例子开始,调试为什么它能工作而你的不能。
打印字节。 I haven't used an example . our app recorded 8k 16 bit single channel data using record and played it back through this library.
How to convert Uint8List to PcmArrayIt16 for playback? I used PcmArrayIt16.fromList (audio) and it couldn't play `properly. If I modify the feed method to the following way, it can play normally