-
-
Notifications
You must be signed in to change notification settings - Fork 628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android suggestion for audio player #3
Comments
@rohansohonee , I was planning to implement much the same using the low level MediaExtractor and AudioTrack APIs which would give me more flexibility in implementing the features I want. E.g. this way, I can implement time stretching and also the |
I am not clear about the You can customize exoplayer |
Hmm, I didn't actually document it well, there, either! Basically, it will play until the given position, then pause. |
By the way, are there specific features that you would like exposed in the flutter API? |
If you can expose Exoplayer features in flutter API that would be awesome. IMPORTANT |
@rohansohonee I am not going to add all of exoplayer's features in just_audio, as it comes with a lot of baggage that is not needed. Can you list specific features you would like to use? |
Gapless playback and Normalize volume if possible. Also have you seen the memory leak report? |
If it's just those two features (in addition to the two already mentioned up the top), I may just implement them myself without bringing in exoplayer, but I'll keep the exoplayer option in mind. (Yes, I have seen your issue on audio_service.) |
I've just implemented time stretching and I haven't looked at normalising the volume. How exactly should this behave? |
Merry Christmas @ryanheise
|
I'm using I should correct my earlier comment: I implemented Thanks for clarifying the normalised volume. I think it's a good idea, but it would require some time consuming and CPU intensive lookahead to determine the average energy of an audio file. If you have any references to articles etc. on how it could be done, that would be welcome. |
I just know that exoplayer has the feature for normalising volume. also rename |
Thanks, I'll look at what exoplayer does. I don't like An alternative could be to remove this parameter and have a separate method to set this position. Then the parameter itself could be named |
|
After |
One more thing which is not yet documented is that the future returned by |
I created two instances of AudioPlayer(). |
Also the glitch occurs when calling play of player B while player A is running. |
There is no |
Reason for gapless audio playback is because i want to cross fade between two tracks i.e fade out volume of current song while simultaneously fading in the next song, thus performing smooth transition. |
Hi @ryanheise I went through the android code and these are the changes you can make:
|
I did look into using ExoPlayer, but I did not see a way to implement FFmpeg sounds good in theory but its license may get in the way of most developers of commercial apps actually being able to use it. See for example: https://trac.ffmpeg.org/ticket/1229 . If it weren't such an issue, I would definitely consider it. After all, FFmpeg would also result in lower battery usage. But in my opinion any cost of battery usage will be minor compared to battery used by the screen, and general performance is not going to be noticeable for the use case of just playing an audio file. I think the performance of FFmpeg would be useful when decoding a whole file in one go for analysis, e.g. to compute the average energy in order to normalise volume, but given the licensing issue, I would prefer to find a cheaper approach that can be done on the fly. Speaking of normalisation, I wasn't able to find this feature in ExoPlayer. I found an issue on it, but it was closed without resolution: google/ExoPlayer#4541 . If you have any information on where it is implemented, I can take a look. |
How is exoplayer using ffmpeg extensions then??? How do i perform gapless playback and Crossfade using your package?? I have tried two instances, where i am starting player B and stopping & immediately starting player A and then stopping player B to try gapless playback. |
https://github.com/google/ExoPlayer/tree/release-v2/extensions/ffmpeg The source code of ffmpeg extensions used in exoplayer. |
It is mentioned on that page:
FFmpeg itself is licensed under the LGPL. However, this is just an optional extension and not everyone using ExoPlayer will be using FFmpeg. |
So how do apps that are using it achieve it?? |
The general consensus online is that you should seek legal advice :-) |
can you help with this issue if possible: How do i perform gapless playback and Crossfade using your package?? I have tried two instances, where i am starting player B and stopping & immediately starting player A and then stopping player B to try gapless playback. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs, or use StackOverflow if you need help with just_audio. |
Hi @ryanheise
Can you use exoplayer at android side instead of media player.
Exoplayer is very feature rich.
The text was updated successfully, but these errors were encountered: