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: 4 months 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.
- Host: GitHub
- URL: https://github.com/alhazmy13/MediaRecorderDialog
- Owner: alhazmy13
- License: mit
- Created: 2015-12-24T11:06:05.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-05T16:40:50.000Z (over 8 years ago)
- Last Synced: 2024-08-16T15:39:30.662Z (8 months ago)
- Language: Java
- Homepage: http://alhazmy13.net
- Size: 634 KB
- Stars: 73
- Watchers: 6
- Forks: 12
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: License.md
Awesome Lists containing this project
- awesome-android - MediaRecorderDialog - Custom Dialog to record audio, store it and play it in your phone. (Libraries / Chat & Messaging)
- awesome-android-libraries - MediaRecorderDialog
- awesome-android - MediaRecorderDialog - Custom Dialog to record audio, store it and play it in your phone. (Libraries / Chat & Messaging)
README
![]()
# Media Recorder Dialog



------
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. :)**

## Installation
------
**Maven**
```xmlnet.alhazmy13.MediaRecorderDialog
libary
1.0.0```
**Gradle**
```gradledependencies {
compile 'net.alhazmy13.MediaRecorderDialog:libary:1.0.0'
}
```# Usage
------
```javanew 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.