audio_play_or_record 1.0.1 copy "audio_play_or_record: ^1.0.1" to clipboard
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
...
4
likes
0
points
418
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for recording, playing audio and displaying interactive waveform with seek support

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

flutter, flutter_animate, just_audio, just_waveform, path_provider, record

More

Packages that depend on audio_play_or_record