Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Waveform when recording #44

Open
thaidmfinnick opened this issue Oct 2, 2023 · 7 comments
Open

[Question] Waveform when recording #44

thaidmfinnick opened this issue Oct 2, 2023 · 7 comments

Comments

@thaidmfinnick
Copy link

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!

@biloshkurskyi-ss
Copy link

Hello @thaidmfinnick The same question from my side. Have you found a good solution for that?

@rutvik110
Copy link
Owner

rutvik110 commented Oct 15, 2023

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.

@thaidmfinnick
Copy link
Author

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.

@lucasjinreal
Copy link

Does there any example ?

@thanglq1
Copy link

thanglq1 commented Feb 1, 2024

Hi, anyone can share example? I also need to show live waveform when recording audio.

@TheWash7
Copy link

I have the same need, has anyone implemented it? Or is there any package that can draw waveforms during recording?

@dancb10
Copy link

dancb10 commented May 15, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants