简体   繁体   中英

Any way to play audio file for windows desktop application in flutter?

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".

You can use this plugin https://pub.dev/packages/just_audio . It supports windows, Mac and Linux also

Have you been able to get https://pub.dev/packages/just_audio working? I get error when I start the application in debug (from android Studio).

[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method init on channel com.ryanheise.just_audio.methods) #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:165:7) #1 MethodChannelJustAudio.init (package:just_audio_platform_interface/method_channel_just_audio.dart:13:5) #2 AudioPlayer._setPlatformActive.setPlatform (package:just_audio/just_audio.dart:1255:13)

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM