h6ah4i / android-openslmediaplayer

Re-implementation of Android's MediaPlayer and audio effect classes based on OpenSL ES APIs.
https://openslmediaplayer.h6ah4i.com
Apache License 2.0
419 stars 97 forks source link

Add changing bitrate for opensl media player #19

Open zZBloodyHellZz opened 8 years ago

zZBloodyHellZz commented 8 years ago

Can you add changing speed function for "opensl media player" depend on changing bitrate ? Thanks!

zZBloodyHellZz commented 8 years ago

I am using your OpenslPlayer lib for my project to stream music online but it can't be able to stream music on Android 5.0 or later :(

h6ah4i commented 8 years ago

@zZBloodyHellZz Hi.

Can you add changing speed function for "opensl media player" depend on changing bitrate ? Thanks!

Unfortunately, I won't add such feature because setting playback rate feature of the Android's OpenSL ES implementation is broken.

ref.) https://code.google.com/p/android/issues/detail?id=186773&thanks=186773&ts=1442506284

Moreover, I do not recommend using OpenSL sink. Since v0.7.0, I have added a new AudioTrack sink (which can be instantiated by using HybridMediaPlayerFactory), because OpenSL ES produces glitches on Android 5.0+. AudioTrack one it is more reliable and produces almost no glitches.


I am using your OpenslPlayer lib for my project to stream music online but it can't be able to stream music on Android 5.0 or later :(

Sorry again. This is also the limitation of Android platform. Network data source playback is broken on Android 5.0+. Please see #9 and #17 for more details. Thanks.

zZBloodyHellZz commented 8 years ago

Thank for your response. I will use your library on a long term and will report you all crashes if they happen to me. Hope you keep develop this lib. It's awesome :).

zZBloodyHellZz commented 8 years ago

So can i use MediaPlayer that is created by HybridMediaPlayerFactory for stream music online with android 5.0 or later and can use Reverb Environment effect?

h6ah4i commented 8 years ago

So can i use MediaPlayer that is created by HybridMediaPlayerFactory for stream music online with android 5.0 or later

No, HybridMediaPlayerFactory creates a player which has OpenSL ES powered source and AudioTrack sink. Streaming online music won't work due to OpenSL ES bug.

Here is summary of the comparison table:

Implementation StandardMediaPlayer OpenSLMediaPlayer HybridMediaPlayer
Source MediaPlayer OpenSL ES OpenSL ES
Sink MediaPlayer OpenSL ES AudioTrack
Stock audio effects yes yes (1') yes
10 Bands equalizer no yes yes
HQ Visualizer no yes yes
Network audio source yes no (2') no (2')
Glitches very-very rare a few times / hour (3') very rare

(1') Stock audio effects (e.g. BassBoost, Virtualizer, ...) does not work on CyanogenMod ROM (2') Network source playback won't work on Android 5.0 or later (ref. #9) (3') Produces glitches on Android 5.0 or later.

and can use Reverb Environment effect?

Yes. But depends on implementation of each devices. I suspect some device does not support it properly.

zZBloodyHellZz commented 8 years ago

Thank you very much, i understood.

Vào Thứ Năm, ngày 01 tháng 9 năm 2016, Haruki Hasegawa < notifications@github.com> đã viết:

So can i use MediaPlayer that is created by HybridMediaPlayerFactory for stream music online with android 5.0 or later

No, HybridMediaPlayerFactory creates a player which has OpenSL ES powered source and AudioTrack sink. Streaming online music won't work due to OpenSL ES bug.

Here is summary of the comparison table: Implementation StandardMediaPlayer OpenSLMediaPlayer HybridMediaPlayer Source MediaPlayer OpenSL ES OpenSL ES Sink MediaPlayer OpenSL ES AudioTrack Stock audio effects yes yes (1') yes 10 Bands equalizer no yes yes HQ Visualizer no yes yes Network audio source yes no (2') no (2') Glitches very-very rare a few times / min. (3') very rare

(1') Stock audio effects (e.g. BassBoost, Virtualizer, ...) does not work on CyanogenMod ROM (2') Network source playback won't work on Android 5.0 or later (ref. #9 https://github.com/h6ah4i/android-openslmediaplayer/issues/9) (3') Produces glitches on Android 5.0 or later.

and can use Reverb Environment effect?

Yes. But depends on implementation of each devices. I suspect some device does not support it properly.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/h6ah4i/android-openslmediaplayer/issues/19#issuecomment-243933468, or mute the thread https://github.com/notifications/unsubscribe-auth/AJVCjwrNoBGabiAMlCZDFwJ825Re8Lewks5qlg52gaJpZM4JxnvS .