Overview
This library offers a compatible class of Android's MediaPlayer class. Not just a re-implementation, also provides some enhanced features;
- Compatible with Android's MediaPlayer and audio effects classes
- Provides both Java and C++ API sets
- Also includes standard MediaPlayer based classes which fixes a lot of bugs
- Smooth fade-in, fade-out
- High quality resampler
- 10 bands graphic equalizer with preamplifier
- High quality Visualizer class to capture audio for visualization purpose
Getting Started
Add these lines into your build.gradle
file.
dependencies {
compile 'com.h6ah4i.android:openslmediaplayer:0.7.5'
}
The minimal example code snippet:
// create
IMediaPlayerFactory factory = new OpenSLMediaPlayerFactory(getApplicationContext());
IBasicMediaPlayer player = factory.createMediaPlayer();
// prepare
player.setDataSource("[path to media file]");
player.prepare();
// start playback
player.start();
// pause playback
player.pause();
// release
player.release();
factory.release();
Demonstration
The source code of these demonstration apps are available as example codes on repository.
Download source code
Documentation
Please refer to Wiki for development information. And the latest JavaDoc can be accessed from here.
License
The OpenSLMediaPlayer library is released under the Apache Software License, Version 2.0.
Copyright 2014-2015 Haruki Hasegawa Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Furthermore, this library contains some third party dependent libraries, so you also have to take care of their licenses.