Thursday, September 28, 2023

Flutter plugin for sound. Audio recorder and player.

Today iam sharing this library for recording and playing music with various codecs in flutter for both android and ios devices.So main purpose of this article is to help anyone that interested in to creating audio recording as well as audio device applications.
So by using this plugin or package we can easy to achive the functionality like record,play,pause or stop .Also its helpfull to load or play audio files from your local storage .for that you need some file access permission to read and write data into SD card.

Features

  • Play and Record sounds .
  • Support with various codecs.
  • Play local files or remote located files specified by their URL.
  • App playback can be controlled from the device lock screen
  • Control from an Apple watch

Requirements

  • Flutter Sound requires an iOS 9.3 SDK (or later)
  • Flutter Sound requires an Android 16 (or later)

Installation

Add following to your package’s pubspec.yaml file:
Check following url to get latest version on Pub and replace below section

dependencies:
  flutter_sound: ^7.4.12+1

After save the flutter_sound packages are automatically downloaded and included into your project.

Checkout below code for sample and installation instructions

Flutter Sound API

Flutter Sound is composed with 4 modules :

To use Flutter Sound you just do :

import 'package:flutter_sound/flutter_sound.dart';

Example (Demo App)

Chec Demo App is a small demonstration of what we can do with Flutter Sound.

This Demo App is a kind of exerciser which try to implement the major Flutter Sound features