Canardoux / flutter_sound

Flutter plugin for sound. Audio recorder and player.
Mozilla Public License 2.0
877 stars 573 forks source link

Support for wave form #513

Closed subhendukundu closed 3 years ago

subhendukundu commented 4 years ago

Is your feature request related to a problem? Please describe.

It's difficult to make real-time waves from an audio recorder such as Instagram.

Describe the solution you'd like

A method to get the wave data which we can pass plugin such as flutter_visualizers.

Describe alternatives you've considered

I haven't found a workaround either.

Larpoux commented 4 years ago

Did you try to startRecorder() to a dart stream ?

subhendukundu commented 4 years ago

Yes! I have it like

await recorder.startRecorder(
      codec: Codec.aacMP4,
      toFile: outputFile.path,
      sampleRate: 16000,
 );

I am trying to get the waves so that I can pass it on to generate the waves in ui. For example

new LineVisualizer(
              waveData: wave,
              height: MediaQuery.of(context).size.height,
              width : MediaQuery.of(context).size.width,
              color: Colors.blueAccent,
 ),
Larpoux commented 4 years ago

You record to a file. If I understand well, you want to get a Stream for sending the data to another plugin. Instead of toFile: you should use toStream: parameter.

Please read this

subhendukundu commented 4 years ago

Sure, Let me try it out. Thanks

Larpoux commented 3 years ago

Please re-open if you have still problems