mploigt / soundpool

Soundpool plugin for Flutter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

soundpool

A Flutter Sound Pool for playing short media files.

Sound Pool caches audio tracks in memory. This can be useful in following scenarios:

  • lower latency between play signal and actual playing of the sound (audio does not need to be read from disc/web),
  • the same sound may be used multiple times.

Inspired by Android SoundPool API.

Example:

    import 'package:soundpool/soundpool.dart';

    Soundpool pool = Soundpool(streamType: StreamType.notification);

    int soundId = await rootBundle.load("sounds/dices.m4a").then((ByteData soundData) {
                  return pool.load(soundData);
                });
    int streamId = await pool.play(soundId);

About

Soundpool plugin for Flutter

License:MIT License


Languages

Language:Dart 48.6%Language:Kotlin 25.5%Language:Swift 16.1%Language:Ruby 8.8%Language:Objective-C 1.0%