3

I'm new to flutter and making a desktop application with flutter. Now I need to load and play audio files but found that the audio player packages don't support desktop software in windows. So if there is any way to play audio file for windows desktop software using flutter, then please give me an example.

Note: After searching a bit I found this (flutter_audio_desktop) but unfortunately it's status is "DISCONTINUED".

2
  • 1
    any update on this? Commented Jun 4, 2022 at 7:03
  • 1
    @YeasinSheikh use just audio - pub.dev/packages/just_audio. Windows support is enabled by adding an additional dependency to your pubspec.yaml alongside just_audio. Follow the readme section for details. Commented Jun 5, 2022 at 8:50

3 Answers 3

1

Dart VLC is also a good option to play audio files for flutter desktop application. This package can play both audio and video files.

Sign up to request clarification or add additional context in comments.

Comments

0

just_audio plugin has a support for windows as well. You can use that plugin to play audio file. There is another plugin named audioplayers which also has windows support in the prelease version 1.0.0-rc.1.

Comments

0

Working solution for 2025 is to use the dart package media_kit.

Player audioPlayer = Player();
Future<void> playAuctionsPosted() async {
  try {
    Media media = await Media.memory((await loadAsset(path: 'audio/auctions_created.mp3')).buffer.asUint8List());
    audioPlayer.open(media);
  } catch (e) {
    log(e.toString());
  }
}

Then in main.dart

MediaKit.ensureInitialized();

Required imports for just audio, if playing video and audio you import only the video package.

media_kit: ^1.1.11
media_kit_libs_audio: ^1.0.5

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.