Skip to content
This repository has been archived by the owner on Sep 13, 2021. It is now read-only.

Linux build fails #33

Open
12people opened this issue Mar 13, 2021 · 16 comments
Open

Linux build fails #33

12people opened this issue Mar 13, 2021 · 16 comments

Comments

@12people
Copy link

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
Copy link

The same problem

@12people
Copy link
Author

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
Copy link
Owner

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
Copy link
Owner

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
Copy link

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
Copy link
Owner

@oscarmoisei

# miniaudio: https://github.com/mackron/miniaudio
# Get miniaudio.h & miniaudio_engine.h from the link above & place at the following location.
audioplayer/miniaudio/*

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

@blindjoedeath
Copy link

blindjoedeath commented Mar 13, 2021

@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
Copy link
Owner

@oscarmoisei oh yeah. I'm so stupid

@alexmercerind
Copy link
Owner

alexmercerind commented Mar 13, 2021

@oscarmoisei

if (this->isLoaded) {w

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

Apologies for my insane stupidness.

@alexmercerind
Copy link
Owner

alexmercerind commented Mar 13, 2021

@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
Copy link

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

@maks
Copy link

maks commented Mar 15, 2021

@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
Copy link
Owner

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
Copy link
Owner

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
Copy link

maks commented Mar 15, 2021

@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
Copy link
Owner

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):

  • Playlists.
  • Network streaming.
  • Better controls.
  • Separated event streams.
  • More performance & stability.
  • And most importantly, better codec/format support.

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants