mehranshoqi / voice_message_player

Play / Show voice messages in your Flutter application.
https://mehran.app
MIT License
77 stars 105 forks source link

play local audio file #35

Open imbryan1999 opened 6 months ago

imbryan1999 commented 6 months ago

i want to play the local recorded file instead of from url.

lucianokapluk commented 5 months ago

i want to play the local recorded file instead of from url.

Did you find the way?

5h3p3rd commented 3 months ago

Hi ! Set the isFile property of the VoiceController to true like bellow:

                VoiceMessageView(
                  backgroundColor: AppColors.greyExtraLight,
                  controller: VoiceController(
                    isFile: true,
                    audioSrc: filePath, // the path to your local recorded file
                    onComplete: () {},
                    onPause: () {},
                    onPlaying: () {},
                    onError: (err) {},
                    maxDuration: const Duration(seconds: 25),
                  ),
                  innerPadding: 8,
                  cornerRadius: 12,
                )

Hope it can help.