audio_waveforms icon indicating copy to clipboard operation
audio_waveforms copied to clipboard

How to listen to the audio while it's paused like WhatsApp?

Open Muhammad-Gamal2 opened this issue 1 year ago • 5 comments

I want the user to listen to the audio without stopping the recording only pausing it so that he can continue recording.

Muhammad-Gamal2 avatar Mar 21 '23 13:03 Muhammad-Gamal2

You can do it by calling recorderController.pause() whenever user taps to play the audio and whenever you pause/stop the playing audio then you call recorderController.record() again recording will start where it left of. All parameter for record are ignored if called after pausing.

If this doesn't resolve your issue please provide your implementation so that we can help you.

ujas-m-simformsolutions avatar Mar 21 '23 15:03 ujas-m-simformsolutions

I want to listen to the same audio while recording it, if it paused

I already do this but it started a new record every time. Here is my code

final appDirectory = await getApplicationDocumentsDirectory(); final path = "${appDirectory.path}/recording.m4a"; final controller = await RecorderController().record(path:path);

then calling to pause controller.pause(); or controller.stop(false);

then initialize the player controller final player = PlayerController(); await player.preparePlayer( path: path ?? '', volume: 1, noOfSamples: 40,);

then start recording again controller?.record(path:path)

Muhammad-Gamal2 avatar Mar 21 '23 16:03 Muhammad-Gamal2

@ujas-m-simformsolutions is there any update?

Muhammad-Gamal2 avatar Mar 28 '23 13:03 Muhammad-Gamal2

Right now it's not possible. Putting it under enhancement.

ujas-m-simformsolutions avatar Apr 14 '23 06:04 ujas-m-simformsolutions