Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/api/__404error.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ <h1>404: Something's gone wrong :-(</h1>
<footer>
<span class="no-break">
medcorder_audio
0.0.6
0.0.7
</span>

</footer>
Expand Down
2 changes: 1 addition & 1 deletion doc/api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ <h2>Libraries</h2>
<footer>
<span class="no-break">
medcorder_audio
0.0.6
0.0.7
</span>

</footer>
Expand Down
18 changes: 9 additions & 9 deletions doc/api/medcorder_audio/MedcorderAudio-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ <h2>Methods</h2>
</span>
</dt>
<dd>

iOS only. close PlayAndRecord audio session

</dd>
<dt id="checkMicrophonePermissions" class="callable">
Expand All @@ -133,7 +133,7 @@ <h2>Methods</h2>
</span>
</dt>
<dd>

Check if you have recording audio permissions

</dd>
<dt id="noSuchMethod" class="callable inherited">
Expand All @@ -151,7 +151,7 @@ <h2>Methods</h2>
</span>
</dt>
<dd>

iOS only. open PlayAndRecord audio session

</dd>
<dt id="setCallBack" class="callable">
Expand All @@ -160,7 +160,7 @@ <h2>Methods</h2>
</span>
</dt>
<dd>
Callback function <a href="../medcorder_audio/MedcorderAudio/setCallBack.html">[...]</a>

</dd>
<dt id="startPlay" class="callable">
Expand All @@ -169,7 +169,7 @@ <h2>Methods</h2>
</span>
</dt>
<dd>

Start audio playing for file with position

</dd>
<dt id="startRecord" class="callable">
Expand All @@ -178,7 +178,7 @@ <h2>Methods</h2>
</span>
</dt>
<dd>

Start record audio file to app documents path

</dd>
<dt id="stopPlay" class="callable">
Expand All @@ -187,7 +187,7 @@ <h2>Methods</h2>
</span>
</dt>
<dd>

Stop audio playing

</dd>
<dt id="stopRecord" class="callable">
Expand All @@ -196,7 +196,7 @@ <h2>Methods</h2>
</span>
</dt>
<dd>

Stop audio recording process

</dd>
<dt id="toString" class="callable inherited">
Expand Down Expand Up @@ -303,7 +303,7 @@ <h2>Constants</h2>
<footer>
<span class="no-break">
medcorder_audio
0.0.6
0.0.7
</span>

</footer>
Expand Down
2 changes: 1 addition & 1 deletion doc/api/medcorder_audio/MedcorderAudio/MedcorderAudio.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ <h2><span>Implementation</span></h2>
<footer>
<span class="no-break">
medcorder_audio
0.0.6
0.0.7
</span>

</footer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ <h5>MedcorderAudio class</h5>
(<wbr>)

</section>
<section class="desc markdown">
<p>iOS only. close PlayAndRecord audio session</p>
</section>

<section class="summary source-code" id="source">
<h2><span>Implementation</span></h2>
Expand All @@ -125,7 +128,7 @@ <h2><span>Implementation</span></h2>
<footer>
<span class="no-break">
medcorder_audio
0.0.6
0.0.7
</span>

</footer>
Expand Down
2 changes: 1 addition & 1 deletion doc/api/medcorder_audio/MedcorderAudio/callback.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ <h2><span>Implementation</span></h2>
<footer>
<span class="no-break">
medcorder_audio
0.0.6
0.0.7
</span>

</footer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ <h5>MedcorderAudio class</h5>
(<wbr>)

</section>
<section class="desc markdown">
<p>Check if you have recording audio permissions</p>
</section>

<section class="summary source-code" id="source">
<h2><span>Implementation</span></h2>
Expand All @@ -126,7 +129,7 @@ <h2><span>Implementation</span></h2>
<footer>
<span class="no-break">
medcorder_audio
0.0.6
0.0.7
</span>

</footer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ <h2><span>Implementation</span></h2>
<footer>
<span class="no-break">
medcorder_audio
0.0.6
0.0.7
</span>

</footer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ <h2><span>Implementation</span></h2>
<footer>
<span class="no-break">
medcorder_audio
0.0.6
0.0.7
</span>

</footer>
Expand Down
5 changes: 4 additions & 1 deletion doc/api/medcorder_audio/MedcorderAudio/setAudioSettings.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ <h5>MedcorderAudio class</h5>
(<wbr>)

</section>
<section class="desc markdown">
<p>iOS only. open PlayAndRecord audio session</p>
</section>

<section class="summary source-code" id="source">
<h2><span>Implementation</span></h2>
Expand All @@ -125,7 +128,7 @@ <h2><span>Implementation</span></h2>
<footer>
<span class="no-break">
medcorder_audio
0.0.6
0.0.7
</span>

</footer>
Expand Down
13 changes: 12 additions & 1 deletion doc/api/medcorder_audio/MedcorderAudio/setCallBack.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@ <h5>MedcorderAudio class</h5>
</ol>)

</section>
<section class="desc markdown">
<p>Callback function</p>
<pre class="language-dart"><code class="language-dart"> void Function(dynamic event)
</code></pre>
<p>Event has <code>code</code> field for get event code</p>
<h2 id="available-events">Available events:</h2>
<h3 id="recording-events">recording events</h3>
<table><thead><tr><th>Key</th><th style="text-align: center;">Type</th><th style="text-align: right;">Description</th></tr></thead><tbody><tr><td>'code'</td><td style="text-align: center;">String</td><td style="text-align: right;">'recording',</td></tr><tr><td>'url'</td><td style="text-align: center;">String</td><td style="text-align: right;">recording file url</td></tr><tr><td>'peakPowerForChannel'</td><td style="text-align: center;">double</td><td style="text-align: right;">peak power for channel</td></tr><tr><td>'currentTime'</td><td style="text-align: center;">double</td><td style="text-align: right;">recording time in seconds</td></tr></tbody></table>
<h3 id="playing-events">playing events</h3>
<table><thead><tr><th>Key</th><th style="text-align: center;">Type</th><th style="text-align: right;">Description</th></tr></thead><tbody><tr><td>'code'</td><td style="text-align: center;">String</td><td style="text-align: right;">'playing', 'audioPlayerDidFinishPlaying'</td></tr><tr><td>'url'</td><td style="text-align: center;">String</td><td style="text-align: right;">playing file url</td></tr><tr><td>'currentTime'</td><td style="text-align: center;">double</td><td style="text-align: right;">playing time in seconds</td></tr><tr><td>'duration'</td><td style="text-align: center;">double</td><td style="text-align: right;">playing file duration</td></tr></tbody></table>
</section>

<section class="summary source-code" id="source">
<h2><span>Implementation</span></h2>
Expand All @@ -119,7 +130,7 @@ <h2><span>Implementation</span></h2>
<footer>
<span class="no-break">
medcorder_audio
0.0.6
0.0.7
</span>

</footer>
Expand Down
5 changes: 4 additions & 1 deletion doc/api/medcorder_audio/MedcorderAudio/startPlay.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ <h5>MedcorderAudio class</h5>
</ol>)

</section>
<section class="desc markdown">
<p>Start audio playing for file with position</p>
</section>

<section class="summary source-code" id="source">
<h2><span>Implementation</span></h2>
Expand All @@ -126,7 +129,7 @@ <h2><span>Implementation</span></h2>
<footer>
<span class="no-break">
medcorder_audio
0.0.6
0.0.7
</span>

</footer>
Expand Down
5 changes: 4 additions & 1 deletion doc/api/medcorder_audio/MedcorderAudio/startRecord.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ <h5>MedcorderAudio class</h5>
</ol>)

</section>
<section class="desc markdown">
<p>Start record audio file to app documents path</p>
</section>

<section class="summary source-code" id="source">
<h2><span>Implementation</span></h2>
Expand All @@ -126,7 +129,7 @@ <h2><span>Implementation</span></h2>
<footer>
<span class="no-break">
medcorder_audio
0.0.6
0.0.7
</span>

</footer>
Expand Down
5 changes: 4 additions & 1 deletion doc/api/medcorder_audio/MedcorderAudio/stopPlay.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ <h5>MedcorderAudio class</h5>
(<wbr>)

</section>
<section class="desc markdown">
<p>Stop audio playing</p>
</section>

<section class="summary source-code" id="source">
<h2><span>Implementation</span></h2>
Expand All @@ -125,7 +128,7 @@ <h2><span>Implementation</span></h2>
<footer>
<span class="no-break">
medcorder_audio
0.0.6
0.0.7
</span>

</footer>
Expand Down
5 changes: 4 additions & 1 deletion doc/api/medcorder_audio/MedcorderAudio/stopRecord.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ <h5>MedcorderAudio class</h5>
(<wbr>)

</section>
<section class="desc markdown">
<p>Stop audio recording process</p>
</section>

<section class="summary source-code" id="source">
<h2><span>Implementation</span></h2>
Expand All @@ -125,7 +128,7 @@ <h2><span>Implementation</span></h2>
<footer>
<span class="no-break">
medcorder_audio
0.0.6
0.0.7
</span>

</footer>
Expand Down
2 changes: 1 addition & 1 deletion doc/api/medcorder_audio/medcorder_audio-library.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ <h5>medcorder_audio library</h5>
<footer>
<span class="no-break">
medcorder_audio
0.0.6
0.0.7
</span>

</footer>
Expand Down
32 changes: 32 additions & 0 deletions lib/medcorder_audio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> setAudioSettings() async {
try {
final String result = await platform.invokeMethod('setAudioSettings');
Expand All @@ -28,6 +53,7 @@ class MedcorderAudio {
}
}

/// iOS only. close PlayAndRecord audio session
Future<String> backAudioSettings() async {
try {
final String result = await platform.invokeMethod('backAudioSettings');
Expand All @@ -39,6 +65,7 @@ class MedcorderAudio {
}
}

/// Start record audio file to app documents path
Future<String> startRecord(String file) async {
try {
final String result = await platform.invokeMethod('startRecord', file);
Expand All @@ -50,6 +77,7 @@ class MedcorderAudio {
}
}

/// Stop audio recording process
Future<String> stopRecord() async {
try {
final String result = await platform.invokeMethod('stopRecord');
Expand All @@ -61,6 +89,7 @@ class MedcorderAudio {
}
}

/// Check if you have recording audio permissions
Future<String> checkMicrophonePermissions() async {
try {
final String result =
Expand All @@ -73,6 +102,7 @@ class MedcorderAudio {
}
}

/// Start audio playing for file with position
Future<String> startPlay(dynamic params) async {
try {
final String result = await platform.invokeMethod('startPlay', params);
Expand All @@ -84,6 +114,7 @@ class MedcorderAudio {
}
}

/// Stop audio playing
Future<String> stopPlay() async {
try {
final String result = await platform.invokeMethod('stopPlay');
Expand All @@ -95,6 +126,7 @@ class MedcorderAudio {
}
}

/// For receiving plugin events you need assign callback function
void _onEvent(dynamic event) {
callback(event);
}
Expand Down