audio_play_or_record 1.0.1
audio_play_or_record: ^1.0.1 copied to clipboard
A Flutter package for recording, playing audio and displaying interactive waveform with seek support
đ§ audio_play_or_record
A Flutter package for recording audio, playing it back, and displaying interactive waveforms with seek support (WhatsApp-style).
⨠Features
đ Audio recording (tap / long-press)
âļī¸ Audio playback with waveform
âą Tap & drag waveform to seek
đ Animated waveform while recording
đ§Š Fully customizable UI (colors, icons, layout)
đ¸ Screenshots
[img.png] [img_1.png] [img_2.png] [img_3.png]
đĻ Installation
Add this to your pubspec.yaml:
dependencies: audio_play_or_record: ^1.0.0
Then run:
flutter pub get
đ Permissions â Android
đ android/app/src/main/AndroidManifest.xml
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.INTERNET"/>
đ iOS
đ ios/Runner/Info.plist
<key>NSMicrophoneUsageDescription</key>
<string>This app needs microphone access to record audio.</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
đ¯ Runtime Permission (Android)
Request microphone permission in the host app:
import 'package:permission_handler/permission_handler.dart';
await Permission.microphone.request();
âšī¸ permission_handler is required only in the host app, not inside this package.
đ§ą Basic Usage đ Audio Message Player
AudioMessage(
audioPath: path,
config: AudioMessageConfig(
activeWaveColor: Colors.greenAccent,
inactiveWaveColor: Colors.black26,
),
)
đ¤ Record Mic Button
RecordMicButton(
hasMicPermission: true,
onRecorded: (path) {
print("Recorded file: $path");
},
onMessageSend: () {},
)
đ¨ Customization
You can customize:
Waveform colors
Bar width & spacing
Icons (mic, play, pause, delete)
Button size & padding
Recording behavior (tap / long-press / lock)
đą Supported Platforms
â Android
â iOS
đ Dependencies Used
* dart:io â For handling audio files and file system operations.
* flutter/material â For UI widgets like buttons, icons, and layout.
* path_provider â To access device directories for saving audio files.
* permission_handler â Not included in the package; the host app must request microphone permission at runtime if needed.
đ License
MIT License
Copyright (c) 2025 Bala Sivanantham <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy
...