im writing a simple FLutter/Dart app that get audio stream from BLE device ( 8Khz, 16Bit, Mono ).. im using flutter_blue as the package to connect the BLE device
i have succeeded in subscribing the service and get the List<int> stream of data for the audio from the BLE devices. As per device's doc, it said the data is 8Khz, 16bit and Mono.
i refer to Save audio stream / Uint8List data in file flutter on how to save the data to WAV file and since the OP used the same kind of audio as me.
However, the file that i save sounds so noisy and makes no sense at all.. i did everything that i can think of:
- assuming the stream is 8bit int, so i convert to 16bit using Buffer ( refer : How is flutter sound stream representing pcm data? ) ( same result ).. confirmed converting is working when print() and the value is between 30000 something instead 255.
- refer to ( https://github.com/anarchuser/mic_stream/issues/9 ) since its like my problem but i cannot set my device to use 8bit encoding since its comes with 16bit encoding.
can someone guide me? im very new to flutter/dart and the syntax confuses me.. ( im coming from PHP )