arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Installation

Flutter Sound installation.

hashtag
Install

For help on adding as a dependency, view the documentationarrow-up-right.

hashtag
Flutter Sound flavors

Flutter Sound comes in two flavors :

  • the FULL flavor : flutter_sound

  • the LITE flavor : flutter_sound_lite

The big difference between the two flavors is that the LITE flavor does not have mobile_ffmpeg embedded inside. There is a huge impact on the memory used, but the LITE flavor will not be able to do :

  • Support some codecs like Playback OGG/OPUS on iOS or Record OGG_OPUS on iOS

  • Will not be able to offer some helping functions, like FlutterSoundHelper.FFmpegGetMediaInformation() or FlutterSoundHelper.duration()

Here are the size of example/demo1 iOS .ipa in Released Mode. Those numbers include everything (flutter library, application, ...) and not only Flutter Sound.

hashtag
Linking your App directly from pub.dev

Add flutter_sound or flutter_sound_lite as a dependency in pubspec.yaml.

The actual versions are :

  • flutter_sound_lite: ^5.0.0 (the LTS version without FFmpeg)

  • flutter_sound: ^5.0.0 (the LTS version with FFmpeg embedded)

  • flutter_sound_lite: ^6.0.0 (the current version without FFmpeg)

or

hashtag
Linking your App with Flutter Sound sources (optional)

The Flutter-Sound sources .

There is actually two branches :

  • V5. This is the Long Term Support (LTS) branch which is maintained under the version 5.x.x

  • master. This is the branch currently developed and is released under the version 6.x.x.

If you want to generate your App from the sources with a FULL flavor:

and add your dependency in your pubspec.yaml :

If you prefer to link your App with the LITE flavor :

and add your dependency in your pubspec.yaml :

hashtag
FFmpeg

flutter_sound FULL flavor makes use of flutter_ffmpeg. In contrary to Flutter Sound Version 3.x.x, in Version 4.0.x your App can be built without any Flutter-FFmpeg dependency. flutter_ffmpeg audio-lts is now embedding inside the FULL flutter_sound.

If your App needs to use FFmpeg audio package, you must use the embedded version inside flutter_sound instead of adding a new dependency in your pubspec.yaml.

If your App needs an other FFmpeg package (for example the "video" package), use the LITE flavor of Flutter Sound and add yourself the App dependency that you need.

hashtag
Post Installation

  • On iOS you need to add usage descriptions to info.plist:

  • On Android you need to add a permission to AndroidManifest.xml:

hashtag
Flutter Web

To use Flutter Sound in a web application, you can either :

hashtag
Static reference

Add those 4 lines at the end of the <head> section of your index.html file :

hashtag
or Dynamic reference

Add those 4 lines at the end of the <head> section of your index.html file :

Please to understand how you can specify the interval of the versions you are interested by.

hashtag
Troubles shooting

hashtag
Problem with Cocoapods

If you get this message (specially after the release of a new Flutter Version) :

you can try the following instructions sequence (and ignore if some commands gives errors) :

If everything good, the last pod install must not give any error.

flutter_sound: ^6.0.0 (the current version with FFmpeg)

Flavor

V4.x

V5.1

LITE

16.2 MB

17.8 MB

FULL

30.7 MB

32.1 MB

are herearrow-up-right
read thisarrow-up-right
dependencies:
  flutter:
    sdk: flutter
  flutter_sound: ^6.0.0
dependencies:
  flutter:
    sdk: flutter
  flutter_sound_lite: ^6.0.0
cd some/where
git clone https://github.com/canardoux/tau
cd some/where/flutter_sound
bin/flavor FULL
dependencies:
  flutter:
    sdk: flutter
  flutter_sound:
    path: some/where/flutter_sound
cd some/where
git clone https://github.com/canardoux/tau
cd some/where/flutter_sound
bin/flavor LITE
dependencies:
  flutter:
    sdk: flutter
  flutter_sound_lite:
    path: some/where/flutter_sound
      <key>NSAppleMusicUsageDescription</key>
      <string>MyApp does not need this permission</string>
      <key>NSCalendarsUsageDescription</key>
      <string>MyApp does not need this permission</string>
      <key>NSCameraUsageDescription</key>
      <string>MyApp does not need this permission</string>
      <key>NSContactsUsageDescription</key>
      <string>MyApp does not need this permission</string>
      <key>NSLocationWhenInUseUsageDescription</key>
      <string>MyApp does not need this permission</string>
      <key>NSMotionUsageDescription</key>
      <string>MyApp does not need this permission</string>
      <key>NSSpeechRecognitionUsageDescription</key>
      <string>MyApp does not need this permission</string>
      <key>UIBackgroundModes</key>
      <array>
              <string>audio</string>
      </array>
      <key>NSMicrophoneUsageDescription</key>
      <string>MyApp uses the microphone to record your speech and convert it to text.</string>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
  <script src="assets/packages/flutter_sound_web/js/flutter_sound/flutter_sound.js"></script>
  <script src="assets/packages/flutter_sound_web/js/flutter_sound/flutter_sound_player.js"></script>
  <script src="assets/packages/flutter_sound_web/js/flutter_sound/flutter_sound_recorder.js"></script>
  <script src="assets/packages/flutter_sound_web/js/howler/howler.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/tau_engine@6/js/flutter_sound/flutter_sound.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/tau_engine@6/js/flutter_sound/flutter_sound_player.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/tau_engine@6/js/flutter_sound/flutter_sound_recorder.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/howler@2/dist/howler.min.js"></script>
Cocoapods could not find compatible versions for pod ...
cd ios
pod cache clean --all
rm Podfile.lock
rm -rf .symlinks/
cd ..
flutter clean
flutter pub get
cd ios
pod update
pod repo update
pod install --repo-update
pod update
pod install
cd ..