diff --git a/doc/api/__404error.html b/doc/api/__404error.html
index e33eff9..9366030 100644
--- a/doc/api/__404error.html
+++ b/doc/api/__404error.html
@@ -77,7 +77,7 @@
404: Something's gone wrong :-(
diff --git a/doc/api/index.html b/doc/api/index.html
index c1d070c..35b1c78 100644
--- a/doc/api/index.html
+++ b/doc/api/index.html
@@ -131,7 +131,7 @@ Libraries
diff --git a/doc/api/medcorder_audio/MedcorderAudio-class.html b/doc/api/medcorder_audio/MedcorderAudio-class.html
index 0da8078..e416bd9 100644
--- a/doc/api/medcorder_audio/MedcorderAudio-class.html
+++ b/doc/api/medcorder_audio/MedcorderAudio-class.html
@@ -124,7 +124,7 @@ Methods
-
+ iOS only. close PlayAndRecord audio session
@@ -133,7 +133,7 @@ Methods
-
+ Check if you have recording audio permissions
@@ -151,7 +151,7 @@ Methods
-
+ iOS only. open PlayAndRecord audio session
@@ -160,7 +160,7 @@ Methods
-
+ Callback function [...]
@@ -169,7 +169,7 @@ Methods
-
+ Start audio playing for file with position
@@ -178,7 +178,7 @@ Methods
-
+ Start record audio file to app documents path
@@ -187,7 +187,7 @@ Methods
-
+ Stop audio playing
@@ -196,7 +196,7 @@ Methods
-
+ Stop audio recording process
@@ -303,7 +303,7 @@ Constants
diff --git a/doc/api/medcorder_audio/MedcorderAudio/MedcorderAudio.html b/doc/api/medcorder_audio/MedcorderAudio/MedcorderAudio.html
index 5b99fca..a95a81d 100644
--- a/doc/api/medcorder_audio/MedcorderAudio/MedcorderAudio.html
+++ b/doc/api/medcorder_audio/MedcorderAudio/MedcorderAudio.html
@@ -117,7 +117,7 @@ Implementation
diff --git a/doc/api/medcorder_audio/MedcorderAudio/backAudioSettings.html b/doc/api/medcorder_audio/MedcorderAudio/backAudioSettings.html
index 543f86f..852facc 100644
--- a/doc/api/medcorder_audio/MedcorderAudio/backAudioSettings.html
+++ b/doc/api/medcorder_audio/MedcorderAudio/backAudioSettings.html
@@ -100,6 +100,9 @@ MedcorderAudio class
()
+
+ iOS only. close PlayAndRecord audio session
+
Implementation
@@ -125,7 +128,7 @@ Implementation
diff --git a/doc/api/medcorder_audio/MedcorderAudio/callback.html b/doc/api/medcorder_audio/MedcorderAudio/callback.html
index 84ec3dc..873176b 100644
--- a/doc/api/medcorder_audio/MedcorderAudio/callback.html
+++ b/doc/api/medcorder_audio/MedcorderAudio/callback.html
@@ -116,7 +116,7 @@ Implementation
diff --git a/doc/api/medcorder_audio/MedcorderAudio/checkMicrophonePermissions.html b/doc/api/medcorder_audio/MedcorderAudio/checkMicrophonePermissions.html
index 82e9967..35ee253 100644
--- a/doc/api/medcorder_audio/MedcorderAudio/checkMicrophonePermissions.html
+++ b/doc/api/medcorder_audio/MedcorderAudio/checkMicrophonePermissions.html
@@ -100,6 +100,9 @@ MedcorderAudio class
()
+
+ Check if you have recording audio permissions
+
Implementation
@@ -126,7 +129,7 @@ Implementation
diff --git a/doc/api/medcorder_audio/MedcorderAudio/eventChannel-constant.html b/doc/api/medcorder_audio/MedcorderAudio/eventChannel-constant.html
index b3ccfbe..7ae00d6 100644
--- a/doc/api/medcorder_audio/MedcorderAudio/eventChannel-constant.html
+++ b/doc/api/medcorder_audio/MedcorderAudio/eventChannel-constant.html
@@ -117,7 +117,7 @@ Implementation
diff --git a/doc/api/medcorder_audio/MedcorderAudio/platform-constant.html b/doc/api/medcorder_audio/MedcorderAudio/platform-constant.html
index 5515bfe..734f1b4 100644
--- a/doc/api/medcorder_audio/MedcorderAudio/platform-constant.html
+++ b/doc/api/medcorder_audio/MedcorderAudio/platform-constant.html
@@ -116,7 +116,7 @@ Implementation
diff --git a/doc/api/medcorder_audio/MedcorderAudio/setAudioSettings.html b/doc/api/medcorder_audio/MedcorderAudio/setAudioSettings.html
index 48d38a2..acc2af1 100644
--- a/doc/api/medcorder_audio/MedcorderAudio/setAudioSettings.html
+++ b/doc/api/medcorder_audio/MedcorderAudio/setAudioSettings.html
@@ -100,6 +100,9 @@ MedcorderAudio class
()
+
+ iOS only. open PlayAndRecord audio session
+
Implementation
@@ -125,7 +128,7 @@ Implementation
diff --git a/doc/api/medcorder_audio/MedcorderAudio/setCallBack.html b/doc/api/medcorder_audio/MedcorderAudio/setCallBack.html
index cf9d1fe..896cb25 100644
--- a/doc/api/medcorder_audio/MedcorderAudio/setCallBack.html
+++ b/doc/api/medcorder_audio/MedcorderAudio/setCallBack.html
@@ -101,6 +101,17 @@ MedcorderAudio class
)
+
+ Callback function
+ void Function(dynamic event)
+
+Event has code field for get event code
+Available events:
+recording events
+| Key | Type | Description |
|---|
| 'code' | String | 'recording', |
| 'url' | String | recording file url |
| 'peakPowerForChannel' | double | peak power for channel |
| 'currentTime' | double | recording time in seconds |
+playing events
+| Key | Type | Description |
|---|
| 'code' | String | 'playing', 'audioPlayerDidFinishPlaying' |
| 'url' | String | playing file url |
| 'currentTime' | double | playing time in seconds |
| 'duration' | double | playing file duration |
+
Implementation
@@ -119,7 +130,7 @@ Implementation
diff --git a/doc/api/medcorder_audio/MedcorderAudio/startPlay.html b/doc/api/medcorder_audio/MedcorderAudio/startPlay.html
index 58d022e..474a5b8 100644
--- a/doc/api/medcorder_audio/MedcorderAudio/startPlay.html
+++ b/doc/api/medcorder_audio/MedcorderAudio/startPlay.html
@@ -101,6 +101,9 @@ MedcorderAudio class
)
+
+ Start audio playing for file with position
+
Implementation
@@ -126,7 +129,7 @@ Implementation
diff --git a/doc/api/medcorder_audio/MedcorderAudio/startRecord.html b/doc/api/medcorder_audio/MedcorderAudio/startRecord.html
index c3f33e4..f162470 100644
--- a/doc/api/medcorder_audio/MedcorderAudio/startRecord.html
+++ b/doc/api/medcorder_audio/MedcorderAudio/startRecord.html
@@ -101,6 +101,9 @@ MedcorderAudio class
)
+
+ Start record audio file to app documents path
+
Implementation
@@ -126,7 +129,7 @@ Implementation
diff --git a/doc/api/medcorder_audio/MedcorderAudio/stopPlay.html b/doc/api/medcorder_audio/MedcorderAudio/stopPlay.html
index 589331e..d5af1a9 100644
--- a/doc/api/medcorder_audio/MedcorderAudio/stopPlay.html
+++ b/doc/api/medcorder_audio/MedcorderAudio/stopPlay.html
@@ -100,6 +100,9 @@ MedcorderAudio class
()
+
Implementation
@@ -125,7 +128,7 @@ Implementation
diff --git a/doc/api/medcorder_audio/MedcorderAudio/stopRecord.html b/doc/api/medcorder_audio/MedcorderAudio/stopRecord.html
index de2b6b8..6d92a2a 100644
--- a/doc/api/medcorder_audio/MedcorderAudio/stopRecord.html
+++ b/doc/api/medcorder_audio/MedcorderAudio/stopRecord.html
@@ -100,6 +100,9 @@ MedcorderAudio class
()
+
+ Stop audio recording process
+
Implementation
@@ -125,7 +128,7 @@ Implementation
diff --git a/doc/api/medcorder_audio/medcorder_audio-library.html b/doc/api/medcorder_audio/medcorder_audio-library.html
index c58bff7..eff0b5f 100644
--- a/doc/api/medcorder_audio/medcorder_audio-library.html
+++ b/doc/api/medcorder_audio/medcorder_audio-library.html
@@ -104,7 +104,7 @@ medcorder_audio library
diff --git a/lib/medcorder_audio.dart b/lib/medcorder_audio.dart
index a4c7a42..4043e4a 100644
--- a/lib/medcorder_audio.dart
+++ b/lib/medcorder_audio.dart
@@ -13,10 +13,35 @@ class MedcorderAudio {
eventChannel.receiveBroadcastStream().listen(_onEvent, onError: _onError);
}
+ /// Callback function
+ ///
+ /// ```dart
+ /// void Function(dynamic event)
+ /// ```
+ ///
+ /// Event has [code] field for get event code
+ ///
+ /// ## Available events:
+ /// ### recording events
+ /// | Key | Type | Description |
+ /// | ------------- |:-------------:| ---------:|
+ /// |'code' |String |'recording', |
+ /// |'url' |String |recording file url|
+ /// |'peakPowerForChannel' |double |peak power for channel|
+ /// |'currentTime' |double |recording time in seconds|
+ ///
+ /// ### playing events
+ /// | Key | Type | Description |
+ /// | ------------- |:-------------:| ---------:|
+ /// |'code' |String |'playing', 'audioPlayerDidFinishPlaying' |
+ /// |'url' |String |playing file url|
+ /// |'currentTime' |double |playing time in seconds|
+ /// |'duration' |double |playing file duration|
void setCallBack(dynamic _callback) {
callback = _callback;
}
+ /// iOS only. open PlayAndRecord audio session
Future setAudioSettings() async {
try {
final String result = await platform.invokeMethod('setAudioSettings');
@@ -28,6 +53,7 @@ class MedcorderAudio {
}
}
+ /// iOS only. close PlayAndRecord audio session
Future backAudioSettings() async {
try {
final String result = await platform.invokeMethod('backAudioSettings');
@@ -39,6 +65,7 @@ class MedcorderAudio {
}
}
+ /// Start record audio file to app documents path
Future startRecord(String file) async {
try {
final String result = await platform.invokeMethod('startRecord', file);
@@ -50,6 +77,7 @@ class MedcorderAudio {
}
}
+ /// Stop audio recording process
Future stopRecord() async {
try {
final String result = await platform.invokeMethod('stopRecord');
@@ -61,6 +89,7 @@ class MedcorderAudio {
}
}
+ /// Check if you have recording audio permissions
Future checkMicrophonePermissions() async {
try {
final String result =
@@ -73,6 +102,7 @@ class MedcorderAudio {
}
}
+ /// Start audio playing for file with position
Future startPlay(dynamic params) async {
try {
final String result = await platform.invokeMethod('startPlay', params);
@@ -84,6 +114,7 @@ class MedcorderAudio {
}
}
+ /// Stop audio playing
Future stopPlay() async {
try {
final String result = await platform.invokeMethod('stopPlay');
@@ -95,6 +126,7 @@ class MedcorderAudio {
}
}
+ /// For receiving plugin events you need assign callback function
void _onEvent(dynamic event) {
callback(event);
}