alexmercerind / flutter_audio_desktop

[WIP] An 🎵 audio playback library for Flutter Desktop. Supports Windows & Linux. Based on miniaudio.
MIT License
53 stars 18 forks source link

Linux build fails #33

Open 12people opened 3 years ago

12people commented 3 years ago

When I try to build for Linux (from Linux), I get this output:

Launching lib/main.dart on Linux in debug mode...
/home/me/git/feeel/linux/flutter/ephemeral/.plugin_symlinks/flutter_audio_desktop/linux/../audioplayer/audioplayer.hpp:119:29: error: expected ';' at end of declaration
/home/me/git/feeel/linux/flutter/ephemeral/.plugin_symlinks/flutter_audio_desktop/linux/../audioplayer/audioplayer.hpp:122:18: error: use of undeclared identifier 'durationPCMFrame'
/home/me/git/feeel/linux/flutter/ephemeral/.plugin_symlinks/flutter_audio_desktop/linux/../audioplayer/audioplayer.hpp:125:39: error: use of undeclared identifier 'durationPCMFrame'
/home/me/git/feeel/linux/flutter/ephemeral/.plugin_symlinks/flutter_audio_desktop/linux/../audioplayer/audioplayer.hpp:135:29: error: expected ';' at end of declaration
/home/me/git/feeel/linux/flutter/ephemeral/.plugin_symlinks/flutter_audio_desktop/linux/../audioplayer/audioplayer.hpp:138:18: error: use of undeclared identifier 'positionPCMFrame'
/home/me/git/feeel/linux/flutter/ephemeral/.plugin_symlinks/flutter_audio_desktop/linux/../audioplayer/audioplayer.hpp:141:39: error: use of undeclared identifier 'positionPCMFrame'
Building Linux application...                                           
Exception: Build process failed

It seems int64 isn't being recognized by the compiler in these lines of code: `unsigned int64 durationPCMFrame; unsigned __int64 positionPCMFrame;`

What can I do about this?

blindjoedeath commented 3 years ago

The same problem

12people commented 3 years ago

Seems like __int64 is Microsoft-specific notation, equivalent to long long.

Could the code be changed to replace __int64 with long long so that it can be compiled from any OS?

alexmercerind commented 3 years ago

Hi there @12people !

You're absolutely correct. I didn't know that __int64 typedef only exists on Windows. Wait let me just replace it.

alexmercerind commented 3 years ago

Apart from above,

I'm currently working on a better implementation of this plugin which will bring a lot lot better control, usability & a really better codec/format support. In-fact, I'm using the really powerful libVLC now, to bring the best audio plugin, that will be ever possible for Windows.

I'm sure that you'll love it & it will be a lot more better in terms of performance & controllability.

Thankyou. I'll inform you soon.

I'm also adding things like proper event listeners, network streaming, better asset support, reading metadata without any external plugin & playlists as well. (It's in a private repo currently).

Learn more here.

blindjoedeath commented 3 years ago

I installed updated version from github, but now I am getting another error:

../audioplayer/audioplayer.hpp:8:10: fatal error: 'miniaudio/miniaudio_engine.h' file not found

I installed miniaudio dependency on my Linux system.

alexmercerind commented 3 years ago

@oscarmoisei

https://github.com/alexmercerind/flutter_audio_desktop/blob/1342211d4f0706585b5d2db11b552e4388f45ea0/.gitignore#L19-L21

You need to place these two files from miniaudio repository to get this to work from github repo.

blindjoedeath commented 3 years ago

@alexmercerind Thank you! That's solved my problem.

By the way, I also had error:

audioplayer/audioplayer.hpp:134:30: error: unknown type name 'w'

I guess it's mistype.

alexmercerind commented 3 years ago

@oscarmoisei oh yeah. I'm so stupid

alexmercerind commented 3 years ago

@oscarmoisei https://github.com/alexmercerind/flutter_audio_desktop/blob/6453b92a283fdf1e1e165907a2c6743afb7e9ca1/audioplayer/audioplayer.hpp#L134

Please remove that "w" and it will work. I'm making commit for it aswell.

Apologies for my insane stupidness.

alexmercerind commented 3 years ago

@oscarmoisei

As I said earlier that I'm working on better implementation of this plugin.

Here are few things that work on Flutter for Windows now (project is still private): main2 111026786-4b262180-8412-11eb-966b-cb7610626219

Not just audio... But videos aswell (I have to embed them inside Flutter window somehow)

main

I'll bring it on Linux soon. I don't know if this project will go popular or not.

Everything works now... playlists, network stream etc. etc.

blindjoedeath commented 3 years ago

@alexmercerind That's great! You are doing a great job

maks commented 3 years ago

@alexmercerind thanks for making this great package. I also got caught out by the missing miniaudio headers and .gitignore is nto really the first place I would think to look for that - maybe would be worthwhile putting this in a build section in the Readme? Also it looks like you are planning to more away from using miniaudio, is that correct?

alexmercerind commented 3 years ago

Hi @maks !

Glad you liked what I did. Sorry for the miniaudio confusion. I didn't check those headers in the source control because no one really used the version from git.

Yep! You are right. I have nearly completed a better, performant, controllable and more codec supporting plugin instead of this one. Now I'm using libVLC, I'll make that plugin public today.

I'll also bring it to plain Dart apps (not just Flutter). I have my middle development screenshots above & things are very stable this time.

I'll possibly still maintain this package as alternative to the heavy libVLC version, because miniaudio is really a little & cool library for the purpose.

Thanks.

alexmercerind commented 3 years ago

Currently I'm building that libVLC version, so I'm unable to fix the problems in this package. This package really has some big problems in general.

maks commented 3 years ago

@alexmercerind thanks for the very quick reply! Yes I've seen now the discussion thread on just_audio package windows support issue. For my use case, I need something lightwieght for linux for a sythesizer audio playback and need it to be useable from pure Dart too, so miniaudio is much better for that than libVLC, so I may end up forking the current version of this library as I think it makes sense for you to contribute windows and linux support to just_audio which needs more functionality than miniaudio provides. Thanks again for writing this library, it makes a perfect starting point for what I need for my project.

alexmercerind commented 3 years ago

Hello @12people & @oscarmoisei !

Thanks for supporting this project. Now libVLC based alternative to this project is live: dart_vlc

It has (in addition to this project):

Other features are in the list. Please use that plugin now instead of this one.

Hope you liked my work. I'm in collaboration with just_audio & assets_audio_player to make Flutter on Windows & Linux a more better place.