audioplayers icon indicating copy to clipboard operation
audioplayers copied to clipboard

windows platform support

Open softmarshmallow opened this issue 4 years ago • 23 comments

flutter desktop is not stable, but we all know it’s future of desktop app development. audioplayer works fine on android ios web and macos but only windows does not have support for it. thous it is experimental i think we should support windows platform in early stage

softmarshmallow avatar Apr 07 '20 10:04 softmarshmallow

not only windows, but linux also needs support.

anyway, we don't have the availability to implement this support at the moment. but we would gladly accept PRs.

erickzanardo avatar Apr 14 '20 14:04 erickzanardo

https://medium.com/flutter-community/towards-full-audio-support-in-flutter-5d15800cdb8b

refering this blog, sound player seems like a solution for windows audio support, (i understand this is off topic, but) will there be any way that i can make plugin with this for windows? (since it's so hard to find any possible example for making flutter windows plugin)

softmarshmallow avatar Apr 18 '20 07:04 softmarshmallow

I have a branch with a basic Windows template setup, but I haven’t had time to work on it lately. Feel free to have a look -> Windows branch However this branch also has some iOS changes I made for a personal project.

ddonze avatar Apr 19 '20 11:04 ddonze

https://github.com/ddonze/audioplayers/blob/384386bd7b69ccce7525fe1c07ac3084e4c136d5/windows/audioplayers_plugin.cpp#L105

haven't run it, but seems like it would work as expected. why wont you submit pr for this? @ddonze

softmarshmallow avatar Apr 22 '20 01:04 softmarshmallow

FYI, the "conversion" from std::string to std::wstring on line 104 will not work if there is any unicode in the path. I would recommend using std::filesystem::u8path to construct a path from the UTF-8 (which is what it is, not ASCII) path you are given.

stuartmorgan avatar Apr 22 '20 04:04 stuartmorgan

@stuartmorgan Yeah, this is literally just a plug-in template file dropped in and wired up to load correctly. But there has been no real development on the actual audio implementation beyond initial tinkering. Feel free to write your own code to fill in the blanks.

ddonze avatar Apr 22 '20 14:04 ddonze

@softmarshmallow The implementation doesn’t really work well or reliably. Most of the work in the branch was just getting the Windows plugin setup. Any actual audio implementation was just me tinkering. Definitely not PR ready

ddonze avatar Apr 22 '20 14:04 ddonze

May use this https://github.com/alexmercerind/flutter_audio_desktop

khismatullin avatar Sep 22 '20 14:09 khismatullin

Hi there everyone 👋!

@luanpotter @erickzanardo @khismatullin @softmarshmallow

I saw that you guys mentioned & asked for support from my repository. My project flutter_audio_desktop is very simple & basic at the moment... I made it for personal usage & supports both Windows & Linux audio playback right now, as there were (are) not any flutter audio libraries supporting Windows & Linux yet. (It's all in C++ & uses exact same code for both Linux & Windows except for the Platform Channels obviously)

I'd love to add support for Windows & Linux in this project. I'll try to fork this project tomorrow (mind the time zones) & make a good PR soon for Windows & Linux support

My project currently has (for Windows & Linux):

  • Playing local files
  • Play/Pause/Stop
  • Getting file duration
  • Seeking
  • MP3, OGG, FLAC, WAV support
  • (I'll add streams along the way as I add support to this project in the same PR).

alexmercerind avatar Sep 23 '20 18:09 alexmercerind

@alexmercerind awesome! Thanks alot for your contribution

softmarshmallow avatar Sep 24 '20 00:09 softmarshmallow

@alexmercerind how is your project coming along? Really hoping to get this for my project and don't want to duplicate your work.

bguan avatar Oct 12 '20 23:10 bguan

copy from audioplayers_web.dart and modified some method with base.dll can easy to realize audioplayers in windows and linux.

Basic functions have been implemented like play pause stop getDuration and more others can be added the same way https://github.com/mabDc/audioplayers/tree/windows

more of bass.dll doc at http://www.un4seen.com/doc/#bass/bass.html http://www.un4seen.com/doc/#bass/BASS_ChannelPlay.html

mabDc avatar Feb 26 '21 12:02 mabDc

As discussed in #944, bass.dll is proprietary and requires hefty licensing fees, so it's not fit for inclusion in an open-source Flutter library.

libao, on the other hand, is open-source, supports Windows AND Linux, and already has a Flutter package. Seems like perhaps the best fit here.

12people avatar Oct 19 '21 09:10 12people

The Windows implementation should use Media Foundation. Since there hasn't been much movement around this issue for a while, would you be willing to accept a PR using it? I'm willing to implement and make this PR. I've already implemented an incomplete video_player version using it, so I'm 100% comfortable porting it to just audio.

azchohfi avatar Jan 24 '22 20:01 azchohfi

@azchohfi Are you working on the PR ?

Mohsen7s avatar Feb 04 '22 11:02 Mohsen7s

Yes, pretty much done, but I want to hear back if this would be accepted or not, before sending the PR.

azchohfi avatar Feb 04 '22 14:02 azchohfi

@azchohfi look at @erickzanardo quote . but we would gladly accept PRs.

Mohsen7s avatar Feb 04 '22 14:02 Mohsen7s

@azchohfi You are amazing. I hope you'll get an answer soon.

I'd like to ask you whether you could give me direction with this issue: https://github.com/bluefireteam/audioplayers/issues/1038 . I'm desperate on this one and need this to be fixed and the authors of this package have not responded for months. I'd love to fix it but have no idea where to start. I'm sure the same issue is also present on the Windows platform, too. Where should I start to fix this please? Is this a hard issue to tackle in your opinion?

tomasbaran avatar Feb 04 '22 15:02 tomasbaran

I don't think #1038 affects this implementation at all. Win32's don't have the concept of background (not like iOS/Android), so it should not be an issue.

azchohfi avatar Feb 08 '22 22:02 azchohfi

flutter desktop is not stable, but we all know it’s future of desktop app development.

By the way, after two years: windows is stable now 🎉

fzyzcjy avatar Mar 08 '22 03:03 fzyzcjy

Hope to see windows support soon...

andreclinio avatar Mar 28 '22 20:03 andreclinio

@azchohfi - I see that your PR is already merged. Does this mean that Windows is now supported?

eximius313 avatar May 17 '22 15:05 eximius313

@eximius313 audioplayers 0.x doesn't support windows, but 1.0.0-rc.1 does.

azchohfi avatar May 26 '22 22:05 azchohfi

Implemented via #1068

Gustl22 avatar Sep 03 '22 09:09 Gustl22