Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A simple themable & integrable audio player library for Android.

License

NotificationsYou must be signed in to change notification settings

jaydeepw/audio-wife

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Audio Wife - Introduction

A simple themable & integrable audio player library for Android. Helps you have an Audio Controllerfor your Audio Player UI. Have your own UI and pass the instance of UI controls likePlay button, Pause button, Seekbar etc to AudioWife and rest is taken care of.

your_player.xml

Audio Player Playing

Audio Player Paused

Demo

Demo Gif

Caution!

Eclipse library project structure has been dropped. If you wish to use this library in your eclipse IDE, please checkouteclipse-develop.No further development will be done or merged intoeclipse-develop branch.

Why this project?

  1. A simple native audio player API wrapper
  2. Others found were complex & provided no way to be integrate as library
  3. Some even involved compilation using Android NDK

Features

  1. Provides default UI truly making it an integrable player.
  2. Ability to set multiple custom click handlers to play and pause buttons.
  3. No dependencies.

Including in your project

AudioWife is presented as anAndroid library project.

You can include this project byreferencing it as a library project inEclipse or ant.

This project has NO DEPENDENCIES.

Download

Gradle:

{compile'net.the4thdimension:audio-wife:1.0.3'}

Requires Android 4.0+.

Getting started

Permission required to play audio

<uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE" />

##Using default player UI

AudioWife comes with a simple default player UI that you can use right away.This is the simplest and fastest way to get AudioWife working.

// mPlayerContainer = Parent view to add default player UI to.AudioWife.getInstance().init(mContext,uri).useDefaultUi(mPlayerContainer,getLayoutInflater());

##Using custom player UI

You can initialize the custom player controls of your UI using AudioWife

// initialize the player controlsmPlayMedia =findViewById(R.id.play);mPauseMedia =findViewById(R.id.pause);mMediaSeekBar = (SeekBar)findViewById(R.id.media_seekbar);mRunTime = (TextView)findViewById(R.id.run_time);mTotalTime = (TextView)findViewById(R.id.total_time);// AudioWife takes care of click handler for play/pause buttonAudioWife.getInstance() .init(mContext,uri) .setPlayView(mPlayMedia) .setPauseView(mPauseMedia) .setSeekBar(mMediaSeekBar) .setRuntimeView(mRunTime) .setTotalTimeView(mTotalTime);// to explicitly pauseAudioWife.getInstance().pause();// when done playing, release the resourcesAudioWife.getInstance().release();

##Add custom listeners

To extend the capabilities of AudioWife, custom click listeners can be attached.Refer to source documentation for more details.

AudioWife.getInstance().addOnCompletionListener(newMediaPlayer.OnCompletionListener() {@OverridepublicvoidonCompletion(MediaPlayermp) {Toast.makeText(getBaseContext(),"Completed",Toast.LENGTH_SHORT) .show();// do you stuff}});AudioWife.getInstance().addOnPlayClickListener(newView.OnClickListener() {@OverridepublicvoidonClick(Viewv) {Toast.makeText(getBaseContext(),"Play",Toast.LENGTH_SHORT) .show();// Lights-Camera-Action. Lets dance.}});AudioWife.getInstance().addOnPauseClickListener(newView.OnClickListener() {@OverridepublicvoidonClick(Viewv) {Toast.makeText(getBaseContext(),"Pause",Toast.LENGTH_SHORT) .show();// Your on audio pause stuff.}});

Why the name 'AudioWife'?

This relates with another Android AudioRecorder library project that is coming soon.The name AudioWife comes from an analogy of a married couple where the wife is an active Player, hence AudioWifefor Audio Player and husband being a Listener hence AudioHusband for Audio Recorder.

Later found that Audio Recorder Library project already exists for Android.You can find ithere.

Contributing

Please fork this repository and contribute back usingpull requests.

Please follow Android codingstyle guide

Developed by

Credits

Official Android MediaPlayer Dev Docs

Android MediaPlayer Tutorial

License

The MIT License (MIT)Copyright (c) 2014 JaydeepPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.

About

A simple themable & integrable audio player library for Android.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp