ryanheise / just_waveform

A Flutter plugin to extract waveform data from an audio file suitable for visual rendering.
MIT License
84 stars 16 forks source link

Extract waveform from audio as uint8list #1

Closed BenCherif closed 2 years ago

BenCherif commented 2 years ago

First thanks for the awesome package , i see that the package extract the wave form audio to a wave file . i wonder if there is a way to extract the wave as (uint8list ) format . Kind regards

loic-hamdi commented 2 years ago

Any solution found?

ryanheise commented 2 years ago

Do you mean you want a parameter to switch between 16 bit and 8 bit resolution while decoding?

BenCherif commented 2 years ago

what i mean instead of extract the wave form audio into a file ,is there away to extract it as uint8list so i can save it as string and send with the message to recipient (use it in chat application).

ryanheise commented 2 years ago

Why not just read the file and you'll obtain the data you need?

BenCherif commented 2 years ago

it's a long process to extract the wave to file and read file as bytes . we talk about chat realtime app .I need to make things simple as i can also i can't read file to get data every time to i want to set the waveform (maybe it will be a list of audio files so the ui will get stuck ).anyway thanks for your help

ryanheise commented 2 years ago

(Bro?) I'm not convinced that reading from the file is slower, I'd imagine it would be faster because sending data through the platform channels has more overheads. The slowest part of the process by far is the actual decoding. The question is whether you need to display intermediate results of the decoding before the complete decoding has taken place. If you need to display intermediate results, then yes that requires an API for streaming the waveform. But if your app can wait until the entire audio is decoded before displaying it (or sending it over the network), then I believe reading the file would be one of the most efficient ways of doing it.

BenCherif commented 2 years ago

Thank you for your help . i will try what u suggest