• Stars
    star
    418
  • Rank 103,620 (Top 3 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 10 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Re-implementation of Android's MediaPlayer and audio effect classes based on OpenSL ES APIs.

OpenSLMediaPlayer

Re-implementation of Android's MediaPlayer and audio effect classes based on OpenSL ES APIs.

Android Arsenal

Motivation

I decided to develop this library to solve these frustrations.

Features

Advantages

  • Provides both C++ and Java API sets
  • Smooth fade in/out when starts/pauses playback
  • High quality resampler
  • 10 bands graphic equalizer & pre. amplifier
  • High quality Visualizer class (floating point, stereo, 32k samples/capture, 60 sampling/second)

Disadvantages

  • Does not support video playback, audio only ( Please use MediaPlayer or ExoPlayer for video playback)
  • Consumes more CPU resources than standard MediaPlayer and other AudioTrack/OpenSL based audio player products (ex. PowerAmp)

Misc.

  • Highly compatibility with standard MediaPlayer and audio effect classes
  • Implements a lot of workarounds, more better behavior and well-tested (Standard* prefixed API classes)
  • Provides Hybrid media player factory which is a player using OpenSL ES for decoding audio and using AudioTrack for playback. This is the most recommended MediaPlayer because it provides more tolerance for audio glitches than OpenSLMediaPlayer but it can use all features of OpenSLMediaPlayer!
  • Provides some compatibility class or methods for older devices
  • NEON/SSE optimized

Target platforms

  • Android API level 14+ (since this library depends decoding feature introduced from API level 14)

Latest version

  • Version 0.7.5 (May 6, 2017)

Demo application (pre-built example apps)

See GitHub Pages site of this project.

Getting started

Use pre-built library (for Android Studio only)

  1. Add these lines to build.gradle of your project
dependencies {
    compile 'com.h6ah4i.android:openslmediaplayer:0.7.5'
}
  1. That's all ;)

Build from source

If you want to build this library from source, please refer to this article.

Documentation

Refer to Wiki and JavaDoc.

ToDos

  • More optimize
  • Improve JavaDoc comments

License

This library is licensed under the Apache Software License, Version 2.0, and contains some source code files delivered from product of Android Open Source Project (AOSP). See AOSP.md for details.

Note that this library uses some third party libraries, so you also have to take care of their licenses.


License of OpenSLMediaPlayer (this library)

See LICENSE for full of the license text.

Copyright (C) 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.

License of dependent libraries

cxxdasp, cxxporthelper, OpenSL ES CXX

These libraries are licensed under the Apache Software License, Version 2.0.

PFFFT

This library is licensed under the FFTPACK5 Software License.

Ne10

This library is licensed under the BSD 3-Clause license.

More Repositories

1

android-advancedrecyclerview

RecyclerView extension library which provides advanced features. (ex. Google's Inbox app like swiping, Play Music app like drag and drop sorting)
Java
5,314
star
2

android-verticalseekbar

Vertical SeekBar class which supports Android 4.x - 9.x.
Java
506
star
3

android-materialshadowninepatch

Provides 9-patch based drop shadow for view elements. Works on API level 9 or later.
Java
482
star
4

android-tablayouthelper

A small library which helps to use TabLayout with ViewPager more easily.
Java
186
star
5

android-scrollableviewpagercontent

Prioritize ViewPager's horizontal swipe action over vertical scroll action of inner contents
Java
39
star
6

mulsellistprefcompat

Backport MultiSelectListPreference class to older android devices
Java
32
star
7

cxxdasp

"cxxdasp" : Digital Audio Signal Processing library for C++
C++
31
star
8

RecyclerViewiOSMailAppLikeSwipe

A simple demo app how to implement iOS Mail app like swipe action
Java
20
star
9

android-numberpickercompat

Backport Material Design NumberPicker widget
Java
7
star
10

android-numberpickerprefcompat

A Preference widget with NumberPicker dialog. Works on API level 14+ devices.
Java
6
star
11

ARVExpandableGridLayout

GridLayoutManager + RecyclerViewExpandableItemManager demo app
Java
5
star
12

android-arduino-fullcolorled

Android + Arduino test program (Full color LED controls)
Shell
4
star
13

tunnel_player_workaround

This sample code shows how to avoid the Tunnel Player, and get visualizer work on Galaxy S4.
Java
3
star
14

MusicVisualizerTaskerPlugin

Official Music Visualizer plugin for integrating with Tasker automation utility app.
Kotlin
3
star
15

AnimatedVectorDrawableCompatProGuardIssue

Java
2
star
16

android-colortransitiondrawable

A Drawable class which supports color transition animation
Java
2
star
17

cxxporthelper

"cxxporthelper": Portable code helper library for C++.
C++
2
star
18

openslescxx

Provides C++ friendly wrapped OpenSL ES APIs
C++
1
star
19

FlexibleSpaceHeaderWithAdvancedRecyclerView

Java
1
star
20

Media2Experiment

Simple demo app using the new androidx.media2's MediaPlayer
Kotlin
1
star
21

DaydreamServiceLeakCheck

Bug check code for "Issue 73652: DreamService instance leaked due to inner DreamServiceWrapper class"
Groovy
1
star
22

MusicVisualizerAPI

Official Intent based API for the Music Visualizer app.
Java
1
star
23

NdkCxxdaspSkeltonApp

Demo Android Studio project integrated with cxxdasp library
Makefile
1
star
24

SwipeableWithSectionRecyclerViewDemo

Java
1
star
25

liblfds-android

Unofficial utility to build liblfds for Android
Shell
1
star
26

mkninepatch

Simple 9-patch image file generator command line tool
Python
1
star