flutter_audio_waveforms
flutter_audio_waveforms copied to clipboard
[Question] Waveform when recording
Hi @rutvik110,
I want to show live waveform when recording audio, I try to combine flutter_audio_waveforms with record library (record to get raw bytes when recording, then I use your load_audio_data.dart to process, but I'm not sure about this idea (and audio cannot run kk). Can you give me some advice or method to do this? Your lib is matched perfectly with my needs.
Thank you!
Hello @thaidmfinnick The same question from my side. Have you found a good solution for that?
I think I was experimenting with something like this sometime ago. Can't remember where that work's rn otherwise I would've point you there. @thaidmfinnick I didn't understood properly where you're stuck on this? In my case, I was using may be a similar library I can't remember which one but just getting those incoming bytes and processing them in chunks of data points(e.g. 256,500,etc) and passing the latest chunk of that data to waveforms was usually working for me. Though there were few things I think I was handling/accounting for here. I'll probably need to dig into it to share that here.
Beside that, if I remember correctly there's one actually really cool package currently being worked by someone in the community for this specific case. I don't remember what was it called right now but I'll try to share it here once I find it.
Thanks @rutvik110 for your response, it seems come from my wrong configuration when using record. Until now, I have not found how to configure. Really hope your sharing about package.
@sergVn I will try some experiment and share if I complete.
Does there any example ?
Hi, anyone can share example? I also need to show live waveform when recording audio.
I have the same need, has anyone implemented it? Or is there any package that can draw waveforms during recording?
I have the same request, I've tried getting the amplitude and then use the method you've had in your example to load and parse json but the result doesn't work.
_audioRecorder = AudioRecorder();
_recordSub = _audioRecorder.onStateChanged().listen((recordState) {
_updateRecordState(recordState);
});
_amplitudeSub = _audioRecorder
.onAmplitudeChanged(const Duration(milliseconds: 300))
.listen((amp) {
setState(() {
_amplitude = amp;
loadparseJson(amp.current);
});
// print(_samples);
});
Ideally, the waveform you see when recording should be the same as when you are playing the audio. Also, I noticed that the recording package outputs the samples as list of doubles in the form of [-53.432430267333984, -53.39674377441406, -56.61314010620117, -56.94035339355469, -57.94402313232422, -60.50706481933594, -56.15440368652344, -56.459468841552734] which I'm not sure is accepted by this package, I'm trying to use with PolygonWaveform. Do you have any suggestions on how to make this work?