Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alhazmy13/MediaRecorderDialog

Android has a built in microphone through which you can capture audio and store it , or play it in your phone. There are many ways to do that but with this dialog you can do all thats with only one dialog.
https://github.com/alhazmy13/MediaRecorderDialog

Last synced: about 1 month ago
JSON representation

Android has a built in microphone through which you can capture audio and store it , or play it in your phone. There are many ways to do that but with this dialog you can do all thats with only one dialog.

Awesome Lists containing this project

README

        




# Media Recorder Dialog
![](https://img.shields.io/badge/Platform-Android-brightgreen.svg)
![](https://img.shields.io/badge/Android-CustomView-blue.svg)
![](https://img.shields.io/crates/l/rustc-serialize.svg)
![](https://img.shields.io/badge/version-1.0.0-blue.svg)

------
Android has a built in microphone through which you can capture audio and store it , or play it in your phone. There are many ways to do that but with this dialog you can do all thats with only one dialog.

You can report any issue on issues page. **Note: If you speak Arabic, you can submit issues with Arabic language and I will check them. :)**

![mediarecorderdialog](https://cloud.githubusercontent.com/assets/4659608/11994579/303214a0-aa52-11e5-9d91-0e88e6b4da4c.gif)

## Installation
------
**Maven**
```xml

net.alhazmy13.MediaRecorderDialog
libary
1.0.0

```

**Gradle**
```gradle

dependencies {
compile 'net.alhazmy13.MediaRecorderDialog:libary:1.0.0'
}
```

# Usage
------
```java

new MediaRecorderDialog.Builder(MainActivity.this)
.setOutputFormat(MediaRecorderDialog.OutputFormat.MPEG_4)
.setAudioEncoder(MediaRecorderDialog.AudioEncoder.AAC)
.setTitle("Recording,,,")
.setMessage("Press the button")
.setOnSaveButtonClickListener(new OnSaveButtonClickListener() {
@Override
public void onSucceed(String path) {
// Toast.makeText(MainActivity.this,path,Toast.LENGTH_SHORT).show();
}
@Override
public void onFailure() {
//Toast.makeText(MainActivity.this,"Failure",Toast.LENGTH_SHORT).show();
}
})
.show();

```

### Implement an `OnSaveButtonClickListener`
In order to receive the path of file, you will need to implement the `OnSaveButtonClickListener` interfaces.
```java
@Override
public void onSucceed(String path) {
//Your Code
}
@Override
public void onFailure() {
//Your Code
}
```

### Additional Options
* `setTitle` You can change the title of Dialog
```java
.setTitle("Recording,,,")
```
* `setMessage` to change the message
```java
.setMessage("Press the button")
```
* `setOutputFormat` You can change the Output format by passing the format from `MediaRecorderDialog.OutputFormat`
```java
.setOutputFormat(MediaRecorderDialog.OutputFormat.MPEG_4)
```
* `setAudioEncoder` You can change the Encoder by passing the value from `MediaRecorderDialog.AudioEncoder`
```java
.setAudioEncoder(MediaRecorderDialog.AudioEncoder.AAC)
```
### Theme and style
You can theme the dialog by overwriting the color resources in your project.
```xml
#00796B
#009688
#80CBC4
```
### Credits
* [Gota Library](https://github.com/alhazmy13/Gota)
* [AndroidViewAnimations](https://github.com/daimajia/AndroidViewAnimations).
* [Android Ripple Background Library](https://github.com/skyfishjy/android-ripple-background)

## License
------

> Copyright (c) 2016 Abdullah Alhazmy

> MIT License

> Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, 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 THE
SOFTWARE.