├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── android ├── .gitignore ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── settings.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── co │ └── medcorder │ └── medcorderaudio │ └── MedcorderAudioPlugin.java ├── doc └── api │ ├── __404error.html │ ├── categories.json │ ├── index.html │ ├── index.json │ ├── medcorder_audio │ ├── MedcorderAudio-class.html │ ├── MedcorderAudio │ │ ├── MedcorderAudio.html │ │ ├── backAudioSettings.html │ │ ├── callback.html │ │ ├── checkMicrophonePermissions.html │ │ ├── eventChannel-constant.html │ │ ├── platform-constant.html │ │ ├── setAudioSettings.html │ │ ├── setCallBack.html │ │ ├── startPlay.html │ │ ├── startRecord.html │ │ ├── stopPlay.html │ │ └── stopRecord.html │ └── medcorder_audio-library.html │ └── static-assets │ ├── favicon.png │ ├── github.css │ ├── highlight.pack.js │ ├── play_button.svg │ ├── readme.md │ ├── script.js │ └── styles.css ├── example ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── medcorder_audio_example │ │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Podfile.lock │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── main.m ├── lib │ └── main.dart ├── medcorder_audio_example.iml ├── pubspec.yaml └── test │ └── widget_test.dart ├── ios ├── .gitignore ├── Assets │ └── .gitkeep ├── Classes │ ├── MedcorderAudioPlugin.h │ └── MedcorderAudioPlugin.m └── medcorder_audio.podspec ├── lib └── medcorder_audio.dart ├── medcorder_audio.iml ├── pubspec.yaml └── test └── medcorder_audio_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | .atom/ 4 | .idea 5 | .packages 6 | .pub/ 7 | build/ 8 | ios/.generated/ 9 | packages 10 | pubspec.lock 11 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 18cd7a3601bcffb36fdf2f679f763b5e827c2e8e 8 | channel: beta 9 | 10 | project_type: plugin 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | # medcorder_audio 4 | 5 | ## Flutter record/play audio plugin. 6 | ### Developed for [Evrone.com](https://evrone.com/) 7 | ### Funded by David Weekly [dweek.ly](https://david.weekly.org/) 8 | 9 | 10 | ## 0.0.2 11 | 12 | * Flutter SDK upgrade 13 | * Dart 2 upgrade 14 | * Errors fix 15 | 16 | ## 0.0.3 17 | 18 | * readme update 19 | 20 | ## 0.0.4 21 | 22 | * description update 23 | 24 | ## 0.0.5 25 | 26 | * flutter upgrade, androidX support 27 | 28 | ## 0.0.6 29 | 30 | * adding dart and flutter badges 31 | 32 | ## 0.0.7 33 | 34 | * added api doc page 35 | * readme updated 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Evrone 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # medcorder_audio 2 | 3 | ## Flutter record/play audio plugin. 4 | [![pub package](https://img.shields.io/pub/v/medcorder_audio.svg)](https://pub.dev/packages/medcorder_audio) 5 | [![Language](https://img.shields.io/badge/language-Dart-blue.svg)](https://dart.dev) 6 | 7 | 8 | Sponsored by Evrone 10 | 11 | 12 | ### Developed for [Evrone.com](https://evrone.com/flutter?utm_source=github&utm_campaign=flutter_audio) 13 | ### Funded by Medcorder [Medcorder.com](https://medcorder.com/) 14 | 15 | ## Getting Started 16 | 17 | For help getting started with Flutter, view our online 18 | [documentation](https://flutter.io/). 19 | 20 | For help on editing plugin code, view the [documentation](https://flutter.io/platform-plugins/#edit-code). 21 | 22 | With the medcorder_audio plugin you can integrate record/play audio support into your flutter app for iOS or Android. 23 | 24 | ## Plugin functions 25 | ### setAudioSettings 26 | **Future setAudioSettings()**\ 27 | iOS only. open PlayAndRecord audio session\ 28 | **returns: 'OK', 'FAIL'** 29 | 30 | ### backAudioSettings 31 | **Future backAudioSettings()**\ 32 | iOS only. close PlayAndRecord audio session\ 33 | **returns: 'OK', 'FAIL'** 34 | 35 | ### startRecord 36 | **Future startRecord(String fileId)**\ 37 | start record audio file to app documents path\ 38 | **returns: 'OK', 'FAIL'** 39 | 40 | ### stopRecord 41 | **Future stopRecord()**\ 42 | stop audio recording process\ 43 | **returns: 'OK', 'FAIL'** 44 | 45 | ### checkMicrophonePermissions 46 | **Future checkMicrophonePermissions()**\ 47 | check if you have recording audio permissions\ 48 | **returns: 'OK', 'NO'** 49 | 50 | ### startPlay 51 | **Future startPlay(dynamic params) async**\ 52 | start audio playing for file with position\ 53 | **returns: 'OK', 'FAIL'**\ 54 | **params: Map** 55 | 56 | | Key | Type | Description | 57 | | ------------- |:-------------:| ---------:| 58 | | file | String | String file Id | 59 | | position | double | play start position in seconds | 60 | 61 | ### stopPlay 62 | **Future stopPlay()**\ 63 | stop audio playing\ 64 | **returns: 'OK', 'FAIL'**\ 65 | 66 | ## Plugin events 67 | for receiving plugin events you need assign callback function\ 68 | **void _onEvent(dynamic event) {...}** 69 | 70 | ### recording events 71 | | Key | Type | Description | 72 | | ------------- |:-------------:| ---------:| 73 | |'code' |String |'recording', | 74 | |'url' |String |recording file url| 75 | |'peakPowerForChannel' |double |peak power for channel| 76 | |'currentTime' |double |recording time in seconds| 77 | 78 | ### playing events 79 | | Key | Type | Description | 80 | | ------------- |:-------------:| ---------:| 81 | |'code' |String |'playing', 'audioPlayerDidFinishPlaying' | 82 | |'url' |String |playing file url| 83 | |'currentTime' |double |playing time in seconds| 84 | |'duration' |double |playing file duration| 85 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'co.medcorder.medcorderaudio' 2 | version '1.0' 3 | 4 | buildscript { 5 | repositories { 6 | google() 7 | jcenter() 8 | } 9 | 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:3.5.0' 12 | } 13 | } 14 | 15 | rootProject.allprojects { 16 | repositories { 17 | google() 18 | jcenter() 19 | } 20 | } 21 | 22 | apply plugin: 'com.android.library' 23 | 24 | android { 25 | compileSdkVersion 28 26 | 27 | defaultConfig { 28 | minSdkVersion 16 29 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 30 | } 31 | lintOptions { 32 | disable 'InvalidPackage' 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 6 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'medcorder_audio' 2 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /android/src/main/java/co/medcorder/medcorderaudio/MedcorderAudioPlugin.java: -------------------------------------------------------------------------------- 1 | package co.medcorder.medcorderaudio; 2 | 3 | import android.Manifest; 4 | import android.app.Activity; 5 | import android.content.Context; 6 | import android.content.pm.PackageManager; 7 | import android.media.MediaPlayer; 8 | import android.media.MediaRecorder; 9 | import android.net.Uri; 10 | import android.util.Log; 11 | 12 | import androidx.core.content.ContextCompat; 13 | 14 | import java.io.File; 15 | import java.util.HashMap; 16 | import java.util.Timer; 17 | import java.util.TimerTask; 18 | 19 | import io.flutter.plugin.common.EventChannel; 20 | import io.flutter.plugin.common.MethodChannel; 21 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler; 22 | import io.flutter.plugin.common.MethodChannel.Result; 23 | import io.flutter.plugin.common.MethodCall; 24 | import io.flutter.plugin.common.PluginRegistry.Registrar; 25 | 26 | /** 27 | * MedcorderAudioPlugin 28 | */ 29 | public class MedcorderAudioPlugin implements MethodCallHandler, EventChannel.StreamHandler { 30 | /** 31 | * Plugin registration. 32 | */ 33 | private static final String TAG = "MEDCORDER"; 34 | private EventChannel.EventSink eventSink; 35 | 36 | private Context context; 37 | private Timer recordTimer; 38 | private Timer playTimer; 39 | 40 | private MediaRecorder recorder; 41 | private String currentOutputFile; 42 | private boolean isRecording = false; 43 | private double recorderSecondsElapsed; 44 | 45 | private MediaPlayer player; 46 | private String currentPlayingFile; 47 | private boolean isPlaying = false; 48 | private double playerSecondsElapsed; 49 | 50 | private Activity activity; 51 | 52 | MedcorderAudioPlugin(Activity _activity){ 53 | this.activity = _activity; 54 | this.context = this.activity.getApplicationContext(); 55 | } 56 | 57 | public static void registerWith(Registrar registrar) { 58 | final MedcorderAudioPlugin plugin = new MedcorderAudioPlugin(registrar.activity()); 59 | 60 | final MethodChannel methodChannel = new MethodChannel(registrar.messenger(), "medcorder_audio"); 61 | methodChannel.setMethodCallHandler(plugin); 62 | 63 | final EventChannel eventChannel = new EventChannel(registrar.messenger(), "medcorder_audio_events"); 64 | eventChannel.setStreamHandler(plugin); 65 | 66 | } 67 | 68 | @Override 69 | public void onListen(Object arguments, EventChannel.EventSink events) { 70 | eventSink = events; 71 | } 72 | 73 | @Override 74 | public void onCancel(Object arguments) { 75 | eventSink = null; 76 | } 77 | 78 | @Override 79 | public void onMethodCall(MethodCall call, Result result) { 80 | if (call.method.equals("setAudioSettings")) { 81 | result.success("OK"); 82 | } else if (call.method.equals("backAudioSettings")) { 83 | result.success("OK"); 84 | } else if (call.method.equals("startRecord")) { 85 | result.success(startRecord((String) call.arguments) ? "OK" : "FAIL"); 86 | } else if (call.method.equals("stopRecord")) { 87 | result.success(stopRecord() ? "OK" : "FAIL"); 88 | } else if (call.method.equals("startPlay")) { 89 | HashMap params = (HashMap) call.arguments; 90 | String fileName = (String) params.get("file"); 91 | double position = (double) params.get("position"); 92 | result.success(startPlay(fileName, position) ? "OK" : "FAIL"); 93 | } else if (call.method.equals("stopPlay")) { 94 | stopPlay(); 95 | result.success("OK"); 96 | } else if (call.method.equals("checkMicrophonePermissions")) { 97 | result.success(checkMicrophonePermissions() ? "OK" : "NO"); 98 | } else { 99 | result.notImplemented(); 100 | } 101 | } 102 | 103 | private void sendEvent(final Object o){ 104 | if (eventSink != null){ 105 | activity.runOnUiThread(new Runnable() { 106 | @Override 107 | public void run() { 108 | eventSink.success(o); 109 | } 110 | }); 111 | } 112 | } 113 | 114 | private boolean checkMicrophonePermissions(){ 115 | int permissionCheck = ContextCompat.checkSelfPermission(activity, 116 | Manifest.permission.RECORD_AUDIO); 117 | boolean permissionGranted = permissionCheck == PackageManager.PERMISSION_GRANTED; 118 | return permissionGranted; 119 | } 120 | 121 | private boolean startRecord(String fileName){ 122 | Log.d(TAG, "startRecord:" + fileName); 123 | recorder = new MediaRecorder(); 124 | try { 125 | currentOutputFile = activity.getApplicationContext().getFilesDir() + "/" + fileName + ".aac"; 126 | recorder.setAudioSource(MediaRecorder.AudioSource.MIC); 127 | int outputFormat = MediaRecorder.OutputFormat.AAC_ADTS; 128 | recorder.setOutputFormat(outputFormat); 129 | int audioEncoder = MediaRecorder.AudioEncoder.AAC; 130 | recorder.setAudioEncoder(audioEncoder); 131 | recorder.setAudioSamplingRate(16000); 132 | recorder.setAudioChannels(2); 133 | recorder.setAudioEncodingBitRate(32000); 134 | recorder.setOutputFile(currentOutputFile); 135 | } 136 | catch(final Exception e) { 137 | return false; 138 | } 139 | 140 | try { 141 | recorder.prepare(); 142 | recorder.start(); 143 | isRecording = true; 144 | startRecordTimer(); 145 | } catch (final Exception e) { 146 | return false; 147 | } 148 | 149 | return true; 150 | } 151 | 152 | public boolean stopRecord(){ 153 | if (!isRecording){ 154 | // sendEvent("recordingFinished"); 155 | return true; 156 | } 157 | 158 | stopRecordTimer(); 159 | isRecording = false; 160 | 161 | try { 162 | recorder.stop(); 163 | recorder.release(); 164 | } 165 | catch (final RuntimeException e) { 166 | return false; 167 | } 168 | finally { 169 | recorder = null; 170 | } 171 | 172 | // sendEvent("recordingFinished"); 173 | return true; 174 | } 175 | 176 | private void startRecordTimer(){ 177 | stopRecordTimer(); 178 | recordTimer = new Timer(); 179 | recordTimer.scheduleAtFixedRate(new TimerTask() { 180 | @Override 181 | public void run() { 182 | updateRecordingWithCode("recording"); 183 | recorderSecondsElapsed = recorderSecondsElapsed + 0.1; 184 | } 185 | }, 0, 100); 186 | } 187 | 188 | private void stopRecordTimer(){ 189 | recorderSecondsElapsed = 0.0; 190 | if (recordTimer != null) { 191 | recordTimer.cancel(); 192 | recordTimer.purge(); 193 | recordTimer = null; 194 | } 195 | } 196 | 197 | private void startPlayTimer(){ 198 | stopPlayTimer(); 199 | playTimer = new Timer(); 200 | playTimer.scheduleAtFixedRate(new TimerTask() { 201 | @Override 202 | public void run() { 203 | updatePlayingWithCode("playing"); 204 | playerSecondsElapsed = playerSecondsElapsed + 0.1; 205 | } 206 | }, 0, 100); 207 | } 208 | 209 | private void stopPlayTimer(){ 210 | playerSecondsElapsed = 0.0; 211 | if (playTimer != null) { 212 | playTimer.cancel(); 213 | playTimer.purge(); 214 | playTimer = null; 215 | } 216 | } 217 | 218 | private boolean startPlay(String fileName, double duration){ 219 | try{ 220 | if (player != null && player.isPlaying()){ 221 | player.stop(); 222 | player.release(); 223 | } 224 | }catch(Exception e){ 225 | 226 | }finally { 227 | player = null; 228 | } 229 | 230 | currentPlayingFile = activity.getApplicationContext().getFilesDir() + "/" + fileName + ".aac"; 231 | File file = new File(currentPlayingFile); 232 | if (file.exists()) { 233 | Uri uri = Uri.fromFile(file); 234 | player = MediaPlayer.create(this.context, uri); 235 | player.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { 236 | boolean callbackWasCalled = false; 237 | 238 | @Override 239 | public synchronized void onCompletion(MediaPlayer mp) { 240 | if (callbackWasCalled) return; 241 | callbackWasCalled = true; 242 | stopPlayTimer(); 243 | updatePlayingWithCode("audioPlayerDidFinishPlaying"); 244 | } 245 | }); 246 | player.seekTo(new Double(duration).intValue() * 1000); 247 | player.start(); 248 | startPlayTimer(); 249 | isPlaying = true; 250 | }else{ 251 | return false; 252 | } 253 | 254 | return true; 255 | } 256 | 257 | private boolean stopPlay(){ 258 | try{ 259 | if (player != null && player.isPlaying()){ 260 | player.stop(); 261 | stopPlayTimer(); 262 | updatePlayingWithCode("audioPlayerDidFinishPlaying"); 263 | player.release(); 264 | } 265 | }catch(Exception e){ 266 | Log.i("MEDCORDER_AUDIO", "Exception:" + e.getMessage()); 267 | } 268 | finally { 269 | player = null; 270 | } 271 | 272 | isPlaying = false; 273 | return true; 274 | } 275 | 276 | private void updateRecordingWithCode(String code){ 277 | HashMap body = new HashMap(); 278 | body.put("code", code); 279 | body.put("url", currentOutputFile); 280 | body.put("peakPowerForChannel", (double) recorder.getMaxAmplitude()); 281 | body.put("currentTime", recorderSecondsElapsed); 282 | sendEvent(body); 283 | } 284 | 285 | private void updatePlayingWithCode(String code){ 286 | HashMap body = new HashMap(); 287 | body.put("code", code); 288 | if (player.isPlaying()) { 289 | body.put("url", currentPlayingFile); 290 | body.put("currentTime", (double) new Double(player.getCurrentPosition()) / 1000.0); 291 | body.put("duration", (double) new Double(player.getDuration()) / 1000.0); 292 | } 293 | sendEvent(body); 294 | } 295 | 296 | } 297 | -------------------------------------------------------------------------------- /doc/api/__404error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | medcorder_audio - Dart API docs 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 |
25 | 26 |
27 | 28 | 31 |
medcorder_audio
32 | 35 |
36 | 37 |
38 | 39 | 56 | 57 |
58 |

404: Something's gone wrong :-(

59 | 60 |
61 |

You've tried to visit a page that doesn't exist. Luckily this site 62 | has other pages.

63 |

If you were looking for something specific, try searching: 64 |

67 |

68 | 69 |
70 |
71 | 72 | 74 | 75 |
76 | 77 |
78 | 79 | medcorder_audio 80 | 0.0.6 81 | 82 | 83 |
84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /doc/api/categories.json: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /doc/api/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | medcorder_audio - Dart API docs 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 |
25 | 26 |
27 | 28 | 31 |
medcorder_audio
32 | 35 |
36 | 37 |
38 | 39 | 56 | 57 |
58 |
59 |

medcorder_audio

60 |

Flutter record/play audio plugin.

61 |

pub package 62 | Language

63 | Sponsored by Evrone 64 | 65 |

Developed for Evrone.com

66 |

Funded by Medcorder Medcorder.com

67 |

Getting Started

68 |

For help getting started with Flutter, view our online 69 | documentation.

70 |

For help on editing plugin code, view the documentation.

71 |

With the medcorder_audio plugin you can integrate record/play audio support into your flutter app for iOS or Android.

72 |

Plugin functions

73 |

setAudioSettings

74 |

Future setAudioSettings()
75 | iOS only. open PlayAndRecord audio session
76 | returns: 'OK', 'FAIL'

77 |

backAudioSettings

78 |

Future backAudioSettings()
79 | iOS only. close PlayAndRecord audio session
80 | returns: 'OK', 'FAIL'

81 |

startRecord

82 |

Future startRecord(String fileId)
83 | start record audio file to app documents path
84 | returns: 'OK', 'FAIL'

85 |

stopRecord

86 |

Future stopRecord()
87 | stop audio recording process
88 | returns: 'OK', 'FAIL'

89 |

checkMicrophonePermissions

90 |

Future checkMicrophonePermissions()
91 | check if you have recording audio permissions
92 | returns: 'OK', 'NO'

93 |

startPlay

94 |

Future startPlay(dynamic params) async
95 | start audio playing for file with position
96 | returns: 'OK', 'FAIL'
97 | params: Map<String, String>

98 |
KeyTypeDescription
fileStringString file Id
positiondoubleplay start position in seconds
99 |

stopPlay

100 |

Future stopPlay()
101 | stop audio playing
102 | returns: 'OK', 'FAIL'\

103 |

Plugin events

104 |

for receiving plugin events you need assign callback function
105 | void _onEvent(dynamic event) {...}

106 |

recording events

107 |
KeyTypeDescription
'code'String'recording',
'url'Stringrecording file url
'peakPowerForChannel'doublepeak power for channel
'currentTime'doublerecording time in seconds
108 |

playing events

109 |
KeyTypeDescription
'code'String'playing', 'audioPlayerDidFinishPlaying'
'url'Stringplaying file url
'currentTime'doubleplaying time in seconds
'duration'doubleplaying file duration
110 |
111 | 112 |
113 |

Libraries

114 |
115 |
116 | medcorder_audio 117 |
118 |
119 | 120 |
121 |
122 |
123 | 124 |
125 | 126 | 128 | 129 |
130 | 131 |
132 | 133 | medcorder_audio 134 | 0.0.6 135 | 136 | 137 |
138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | -------------------------------------------------------------------------------- /doc/api/index.json: -------------------------------------------------------------------------------- 1 | [{"name":"medcorder_audio","qualifiedName":"medcorder_audio","href":"medcorder_audio/medcorder_audio-library.html","type":"library","overriddenDepth":0,"packageName":"medcorder_audio"},{"name":"MedcorderAudio","qualifiedName":"medcorder_audio.MedcorderAudio","href":"medcorder_audio/MedcorderAudio-class.html","type":"class","overriddenDepth":0,"packageName":"medcorder_audio","enclosedBy":{"name":"medcorder_audio","type":"library"}},{"name":"MedcorderAudio","qualifiedName":"medcorder_audio.MedcorderAudio.MedcorderAudio","href":"medcorder_audio/MedcorderAudio/MedcorderAudio.html","type":"constructor","overriddenDepth":0,"packageName":"medcorder_audio","enclosedBy":{"name":"MedcorderAudio","type":"class"}},{"name":"backAudioSettings","qualifiedName":"medcorder_audio.MedcorderAudio.backAudioSettings","href":"medcorder_audio/MedcorderAudio/backAudioSettings.html","type":"method","overriddenDepth":0,"packageName":"medcorder_audio","enclosedBy":{"name":"MedcorderAudio","type":"class"}},{"name":"callback","qualifiedName":"medcorder_audio.MedcorderAudio.callback","href":"medcorder_audio/MedcorderAudio/callback.html","type":"property","overriddenDepth":0,"packageName":"medcorder_audio","enclosedBy":{"name":"MedcorderAudio","type":"class"}},{"name":"checkMicrophonePermissions","qualifiedName":"medcorder_audio.MedcorderAudio.checkMicrophonePermissions","href":"medcorder_audio/MedcorderAudio/checkMicrophonePermissions.html","type":"method","overriddenDepth":0,"packageName":"medcorder_audio","enclosedBy":{"name":"MedcorderAudio","type":"class"}},{"name":"eventChannel","qualifiedName":"medcorder_audio.MedcorderAudio.eventChannel","href":"medcorder_audio/MedcorderAudio/eventChannel-constant.html","type":"constant","overriddenDepth":0,"packageName":"medcorder_audio","enclosedBy":{"name":"MedcorderAudio","type":"class"}},{"name":"platform","qualifiedName":"medcorder_audio.MedcorderAudio.platform","href":"medcorder_audio/MedcorderAudio/platform-constant.html","type":"constant","overriddenDepth":0,"packageName":"medcorder_audio","enclosedBy":{"name":"MedcorderAudio","type":"class"}},{"name":"setAudioSettings","qualifiedName":"medcorder_audio.MedcorderAudio.setAudioSettings","href":"medcorder_audio/MedcorderAudio/setAudioSettings.html","type":"method","overriddenDepth":0,"packageName":"medcorder_audio","enclosedBy":{"name":"MedcorderAudio","type":"class"}},{"name":"setCallBack","qualifiedName":"medcorder_audio.MedcorderAudio.setCallBack","href":"medcorder_audio/MedcorderAudio/setCallBack.html","type":"method","overriddenDepth":0,"packageName":"medcorder_audio","enclosedBy":{"name":"MedcorderAudio","type":"class"}},{"name":"startPlay","qualifiedName":"medcorder_audio.MedcorderAudio.startPlay","href":"medcorder_audio/MedcorderAudio/startPlay.html","type":"method","overriddenDepth":0,"packageName":"medcorder_audio","enclosedBy":{"name":"MedcorderAudio","type":"class"}},{"name":"startRecord","qualifiedName":"medcorder_audio.MedcorderAudio.startRecord","href":"medcorder_audio/MedcorderAudio/startRecord.html","type":"method","overriddenDepth":0,"packageName":"medcorder_audio","enclosedBy":{"name":"MedcorderAudio","type":"class"}},{"name":"stopPlay","qualifiedName":"medcorder_audio.MedcorderAudio.stopPlay","href":"medcorder_audio/MedcorderAudio/stopPlay.html","type":"method","overriddenDepth":0,"packageName":"medcorder_audio","enclosedBy":{"name":"MedcorderAudio","type":"class"}},{"name":"stopRecord","qualifiedName":"medcorder_audio.MedcorderAudio.stopRecord","href":"medcorder_audio/MedcorderAudio/stopRecord.html","type":"method","overriddenDepth":0,"packageName":"medcorder_audio","enclosedBy":{"name":"MedcorderAudio","type":"class"}}] 2 | -------------------------------------------------------------------------------- /doc/api/medcorder_audio/MedcorderAudio-class.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | MedcorderAudio class - medcorder_audio library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 |
24 | 25 |
26 | 27 | 32 |
MedcorderAudio
33 | 36 |
37 | 38 |
39 | 40 | 68 | 69 |
70 |

MedcorderAudio class

71 | 72 | 73 | 74 |
75 |

Constructors

76 | 77 |
78 |
79 | MedcorderAudio() 80 |
81 |
82 | 83 |
84 |
85 |
86 | 87 |
88 |

Properties

89 | 90 |
91 |
92 | callback 93 | ↔ dynamic 94 |
95 |
96 | 97 |
read / write
98 |
99 |
100 | hashCode 101 | int 102 |
103 |
104 | The hash code for this object. [...] 105 |
read-only, inherited
106 |
107 |
108 | runtimeType 109 | Type 110 |
111 |
112 | A representation of the runtime type of the object. 113 |
read-only, inherited
114 |
115 |
116 |
117 | 118 |
119 |

Methods

120 |
121 |
122 | backAudioSettings() 123 | Future<String> 124 | 125 |
126 |
127 | 128 | 129 |
130 |
131 | checkMicrophonePermissions() 132 | Future<String> 133 | 134 |
135 |
136 | 137 | 138 |
139 |
140 | noSuchMethod(Invocation invocation) 141 | → dynamic 142 | 143 |
144 |
145 | Invoked when a non-existent method or property is accessed. [...] 146 |
inherited
147 |
148 |
149 | setAudioSettings() 150 | Future<String> 151 | 152 |
153 |
154 | 155 | 156 |
157 |
158 | setCallBack(dynamic _callback) 159 | → void 160 | 161 |
162 |
163 | 164 | 165 |
166 |
167 | startPlay(dynamic params) 168 | Future<String> 169 | 170 |
171 |
172 | 173 | 174 |
175 |
176 | startRecord(String file) 177 | Future<String> 178 | 179 |
180 |
181 | 182 | 183 |
184 |
185 | stopPlay() 186 | Future<String> 187 | 188 |
189 |
190 | 191 | 192 |
193 |
194 | stopRecord() 195 | Future<String> 196 | 197 |
198 |
199 | 200 | 201 |
202 |
203 | toString() 204 | String 205 | 206 |
207 |
208 | A string representation of this object. [...] 209 |
inherited
210 |
211 |
212 |
213 | 214 |
215 |

Operators

216 |
217 |
218 | operator ==(Object other) 219 | bool 220 | 221 |
222 |
223 | The equality operator. [...] 224 |
inherited
225 |
226 |
227 |
228 | 229 | 230 | 231 |
232 |

Constants

233 | 234 |
235 |
236 | eventChannel 237 | → const EventChannel 238 |
239 |
240 | 241 | 242 |
243 | const EventChannel('medcorder_audio_events') 244 |
245 |
246 |
247 | platform 248 | → const MethodChannel 249 |
250 |
251 | 252 | 253 |
254 | const MethodChannel('medcorder_audio') 255 |
256 |
257 |
258 |
259 | 260 |
261 | 262 | 300 | 301 |
302 | 303 |
304 | 305 | medcorder_audio 306 | 0.0.6 307 | 308 | 309 |
310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | -------------------------------------------------------------------------------- /doc/api/medcorder_audio/MedcorderAudio/MedcorderAudio.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | MedcorderAudio constructor - MedcorderAudio class - medcorder_audio library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 |
24 | 25 |
26 | 27 | 33 |
MedcorderAudio
34 | 37 |
38 | 39 |
40 | 41 | 93 | 94 |
95 |

MedcorderAudio constructor

96 | 97 |
98 | 99 | MedcorderAudio() 100 |
101 | 102 | 103 |
104 |

Implementation

105 |
MedcorderAudio() {
106 |   eventChannel.receiveBroadcastStream().listen(_onEvent, onError: _onError);
107 | }
108 |
109 | 110 |
111 | 112 | 114 | 115 |
116 | 117 |
118 | 119 | medcorder_audio 120 | 0.0.6 121 | 122 | 123 |
124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /doc/api/medcorder_audio/MedcorderAudio/backAudioSettings.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | backAudioSettings method - MedcorderAudio class - medcorder_audio library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 |
24 | 25 |
26 | 27 | 33 |
backAudioSettings
34 | 37 |
38 | 39 |
40 | 41 | 93 | 94 |
95 |

backAudioSettings method

96 | 97 |
98 | Future<String> 99 | backAudioSettings 100 | () 101 | 102 |
103 | 104 |
105 |

Implementation

106 |
Future<String> backAudioSettings() async {
107 |   try {
108 |     final String result = await platform.invokeMethod('backAudioSettings');
109 |     print('backAudioSettings: ' + result);
110 |     return result;
111 |   } catch (e) {
112 |     print('backAudioSettings: fail');
113 |     return 'fail';
114 |   }
115 | }
116 |
117 | 118 |
119 | 120 | 122 | 123 |
124 | 125 |
126 | 127 | medcorder_audio 128 | 0.0.6 129 | 130 | 131 |
132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | -------------------------------------------------------------------------------- /doc/api/medcorder_audio/MedcorderAudio/callback.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | callback property - MedcorderAudio class - medcorder_audio library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 |
24 | 25 |
26 | 27 | 33 |
callback
34 | 37 |
38 | 39 |
40 | 41 | 93 | 94 |
95 |

callback property

96 | 97 |
98 | dynamic 99 | callback 100 |
read / write
101 |
102 |
103 |

Implementation

104 |
dynamic callback;
105 | 
106 | 
107 |
108 | 109 |
110 | 111 | 113 | 114 |
115 | 116 |
117 | 118 | medcorder_audio 119 | 0.0.6 120 | 121 | 122 |
123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /doc/api/medcorder_audio/MedcorderAudio/checkMicrophonePermissions.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | checkMicrophonePermissions method - MedcorderAudio class - medcorder_audio library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 |
24 | 25 |
26 | 27 | 33 |
checkMicrophonePermissions
34 | 37 |
38 | 39 |
40 | 41 | 93 | 94 |
95 |

checkMicrophonePermissions method

96 | 97 |
98 | Future<String> 99 | checkMicrophonePermissions 100 | () 101 | 102 |
103 | 104 |
105 |

Implementation

106 |
Future<String> checkMicrophonePermissions() async {
107 |   try {
108 |     final String result =
109 |         await platform.invokeMethod('checkMicrophonePermissions');
110 |     print('stopPlay: ' + result);
111 |     return result;
112 |   } catch (e) {
113 |     print('stopPlay: fail');
114 |     return 'fail';
115 |   }
116 | }
117 |
118 | 119 |
120 | 121 | 123 | 124 |
125 | 126 |
127 | 128 | medcorder_audio 129 | 0.0.6 130 | 131 | 132 |
133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /doc/api/medcorder_audio/MedcorderAudio/eventChannel-constant.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | eventChannel constant - MedcorderAudio class - medcorder_audio library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 |
24 | 25 |
26 | 27 | 33 |
eventChannel
34 | 37 |
38 | 39 |
40 | 41 | 93 | 94 |
95 |

eventChannel constant

96 | 97 |
98 | EventChannel 99 | const eventChannel 100 | 101 |
102 |
103 |

Implementation

104 |
static const EventChannel eventChannel =
105 |     const EventChannel('medcorder_audio_events');
106 | 
107 | 
108 |
109 | 110 |
111 | 112 | 114 | 115 |
116 | 117 |
118 | 119 | medcorder_audio 120 | 0.0.6 121 | 122 | 123 |
124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /doc/api/medcorder_audio/MedcorderAudio/platform-constant.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | platform constant - MedcorderAudio class - medcorder_audio library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 |
24 | 25 |
26 | 27 | 33 |
platform
34 | 37 |
38 | 39 |
40 | 41 | 93 | 94 |
95 |

platform constant

96 | 97 |
98 | MethodChannel 99 | const platform 100 | 101 |
102 |
103 |

Implementation

104 |
static const MethodChannel platform = const MethodChannel('medcorder_audio');
105 | 
106 | 
107 |
108 | 109 |
110 | 111 | 113 | 114 |
115 | 116 |
117 | 118 | medcorder_audio 119 | 0.0.6 120 | 121 | 122 |
123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /doc/api/medcorder_audio/MedcorderAudio/setAudioSettings.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | setAudioSettings method - MedcorderAudio class - medcorder_audio library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 |
24 | 25 |
26 | 27 | 33 |
setAudioSettings
34 | 37 |
38 | 39 |
40 | 41 | 93 | 94 |
95 |

setAudioSettings method

96 | 97 |
98 | Future<String> 99 | setAudioSettings 100 | () 101 | 102 |
103 | 104 |
105 |

Implementation

106 |
Future<String> setAudioSettings() async {
107 |   try {
108 |     final String result = await platform.invokeMethod('setAudioSettings');
109 |     print('setAudioSettings: ' + result);
110 |     return result;
111 |   } catch (e) {
112 |     print('setAudioSettings: fail');
113 |     return 'fail';
114 |   }
115 | }
116 |
117 | 118 |
119 | 120 | 122 | 123 |
124 | 125 |
126 | 127 | medcorder_audio 128 | 0.0.6 129 | 130 | 131 |
132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | -------------------------------------------------------------------------------- /doc/api/medcorder_audio/MedcorderAudio/setCallBack.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | setCallBack method - MedcorderAudio class - medcorder_audio library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 |
24 | 25 |
26 | 27 | 33 |
setCallBack
34 | 37 |
38 | 39 |
40 | 41 | 93 | 94 |
95 |

setCallBack method

96 | 97 |
98 | void 99 | setCallBack 100 | (
  1. dynamic _callback
  2. 101 |
) 102 | 103 |
104 | 105 |
106 |

Implementation

107 |
void setCallBack(dynamic _callback) {
108 |   callback = _callback;
109 | }
110 |
111 | 112 |
113 | 114 | 116 | 117 |
118 | 119 |
120 | 121 | medcorder_audio 122 | 0.0.6 123 | 124 | 125 |
126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /doc/api/medcorder_audio/MedcorderAudio/startPlay.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | startPlay method - MedcorderAudio class - medcorder_audio library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 |
24 | 25 |
26 | 27 | 33 |
startPlay
34 | 37 |
38 | 39 |
40 | 41 | 93 | 94 |
95 |

startPlay method

96 | 97 |
98 | Future<String> 99 | startPlay 100 | (
  1. dynamic params
  2. 101 |
) 102 | 103 |
104 | 105 |
106 |

Implementation

107 |
Future<String> startPlay(dynamic params) async {
108 |   try {
109 |     final String result = await platform.invokeMethod('startPlay', params);
110 |     print('startPlay: ' + result);
111 |     return result;
112 |   } catch (e) {
113 |     print('startPlay: fail');
114 |     return 'fail';
115 |   }
116 | }
117 |
118 | 119 |
120 | 121 | 123 | 124 |
125 | 126 |
127 | 128 | medcorder_audio 129 | 0.0.6 130 | 131 | 132 |
133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /doc/api/medcorder_audio/MedcorderAudio/startRecord.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | startRecord method - MedcorderAudio class - medcorder_audio library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 |
24 | 25 |
26 | 27 | 33 |
startRecord
34 | 37 |
38 | 39 |
40 | 41 | 93 | 94 |
95 |

startRecord method

96 | 97 |
98 | Future<String> 99 | startRecord 100 | (
  1. String file
  2. 101 |
) 102 | 103 |
104 | 105 |
106 |

Implementation

107 |
Future<String> startRecord(String file) async {
108 |   try {
109 |     final String result = await platform.invokeMethod('startRecord', file);
110 |     print('startRecord: ' + result);
111 |     return result;
112 |   } catch (e) {
113 |     print('startRecord: fail');
114 |     return 'fail';
115 |   }
116 | }
117 |
118 | 119 |
120 | 121 | 123 | 124 |
125 | 126 |
127 | 128 | medcorder_audio 129 | 0.0.6 130 | 131 | 132 |
133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /doc/api/medcorder_audio/MedcorderAudio/stopPlay.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | stopPlay method - MedcorderAudio class - medcorder_audio library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 |
24 | 25 |
26 | 27 | 33 |
stopPlay
34 | 37 |
38 | 39 |
40 | 41 | 93 | 94 |
95 |

stopPlay method

96 | 97 |
98 | Future<String> 99 | stopPlay 100 | () 101 | 102 |
103 | 104 |
105 |

Implementation

106 |
Future<String> stopPlay() async {
107 |   try {
108 |     final String result = await platform.invokeMethod('stopPlay');
109 |     print('stopPlay: ' + result);
110 |     return result;
111 |   } catch (e) {
112 |     print('stopPlay: fail');
113 |     return 'fail';
114 |   }
115 | }
116 |
117 | 118 |
119 | 120 | 122 | 123 |
124 | 125 |
126 | 127 | medcorder_audio 128 | 0.0.6 129 | 130 | 131 |
132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | -------------------------------------------------------------------------------- /doc/api/medcorder_audio/MedcorderAudio/stopRecord.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | stopRecord method - MedcorderAudio class - medcorder_audio library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 |
24 | 25 |
26 | 27 | 33 |
stopRecord
34 | 37 |
38 | 39 |
40 | 41 | 93 | 94 |
95 |

stopRecord method

96 | 97 |
98 | Future<String> 99 | stopRecord 100 | () 101 | 102 |
103 | 104 |
105 |

Implementation

106 |
Future<String> stopRecord() async {
107 |   try {
108 |     final String result = await platform.invokeMethod('stopRecord');
109 |     print('stopRecord: ' + result);
110 |     return result;
111 |   } catch (e) {
112 |     print('stopRecord: fail');
113 |     return 'fail';
114 |   }
115 | }
116 |
117 | 118 |
119 | 120 | 122 | 123 |
124 | 125 |
126 | 127 | medcorder_audio 128 | 0.0.6 129 | 130 | 131 |
132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | -------------------------------------------------------------------------------- /doc/api/medcorder_audio/medcorder_audio-library.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | medcorder_audio library - Dart API 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 |
24 | 25 |
26 | 27 | 31 |
medcorder_audio
32 | 35 |
36 | 37 |
38 | 39 | 57 | 58 |
59 |

medcorder_audio library

60 | 61 | 62 |
63 |

Classes

64 | 65 |
66 |
67 | MedcorderAudio 68 |
69 |
70 | 71 |
72 |
73 |
74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 |
84 | 85 | 101 | 102 |
103 | 104 |
105 | 106 | medcorder_audio 107 | 0.0.6 108 | 109 | 110 |
111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /doc/api/static-assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/doc/api/static-assets/favicon.png -------------------------------------------------------------------------------- /doc/api/static-assets/github.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | github.com style (c) Vasily Polovnyov 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | color: #333; 12 | background: #f8f8f8; 13 | } 14 | 15 | .hljs-comment, 16 | .hljs-quote { 17 | color: #998; 18 | font-style: italic; 19 | } 20 | 21 | .hljs-keyword, 22 | .hljs-selector-tag, 23 | .hljs-subst { 24 | color: #333; 25 | font-weight: bold; 26 | } 27 | 28 | .hljs-number, 29 | .hljs-literal, 30 | .hljs-variable, 31 | .hljs-template-variable, 32 | .hljs-tag .hljs-attr { 33 | color: #008080; 34 | } 35 | 36 | .hljs-string, 37 | .hljs-doctag { 38 | color: #d14; 39 | } 40 | 41 | .hljs-title, 42 | .hljs-section, 43 | .hljs-selector-id { 44 | color: #900; 45 | font-weight: bold; 46 | } 47 | 48 | .hljs-subst { 49 | font-weight: normal; 50 | } 51 | 52 | .hljs-type, 53 | .hljs-class .hljs-title { 54 | color: #458; 55 | font-weight: bold; 56 | } 57 | 58 | .hljs-tag, 59 | .hljs-name, 60 | .hljs-attribute { 61 | color: #000080; 62 | font-weight: normal; 63 | } 64 | 65 | .hljs-regexp, 66 | .hljs-link { 67 | color: #009926; 68 | } 69 | 70 | .hljs-symbol, 71 | .hljs-bullet { 72 | color: #990073; 73 | } 74 | 75 | .hljs-built_in, 76 | .hljs-builtin-name { 77 | color: #0086b3; 78 | } 79 | 80 | .hljs-meta { 81 | color: #999; 82 | font-weight: bold; 83 | } 84 | 85 | .hljs-deletion { 86 | background: #fdd; 87 | } 88 | 89 | .hljs-addition { 90 | background: #dfd; 91 | } 92 | 93 | .hljs-emphasis { 94 | font-style: italic; 95 | } 96 | 97 | .hljs-strong { 98 | font-weight: bold; 99 | } 100 | -------------------------------------------------------------------------------- /doc/api/static-assets/play_button.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/api/static-assets/readme.md: -------------------------------------------------------------------------------- 1 | # highlight.js 2 | 3 | Generated from https://highlightjs.org/download/ on 2020-12-30 4 | 5 | Included languages: 6 | 7 | * bash 8 | * css 9 | * dart 10 | * html, xml 11 | * java 12 | * javascript 13 | * json 14 | * kotlin 15 | * markdown 16 | * objective-c 17 | * shell 18 | * swift 19 | * yaml 20 | -------------------------------------------------------------------------------- /doc/api/static-assets/script.js: -------------------------------------------------------------------------------- 1 | function initSideNav() { 2 | const leftNavToggle = document.getElementById('sidenav-left-toggle'); 3 | const leftDrawer = document.querySelector('.sidebar-offcanvas-left'); 4 | const overlay = document.getElementById('overlay-under-drawer'); 5 | 6 | function toggleBoth() { 7 | if (leftDrawer) { 8 | leftDrawer.classList.toggle('active'); 9 | } 10 | 11 | if (overlay) { 12 | overlay.classList.toggle('active'); 13 | } 14 | } 15 | 16 | if (overlay) { 17 | overlay.addEventListener('click', toggleBoth); 18 | } 19 | 20 | if (leftNavToggle) { 21 | leftNavToggle.addEventListener('click', toggleBoth); 22 | } 23 | } 24 | 25 | function saveLeftScroll() { 26 | const leftSidebar = document.getElementById('dartdoc-sidebar-left'); 27 | sessionStorage.setItem('dartdoc-sidebar-left-scrollt' + window.location.pathname, leftSidebar.scrollTop.toString()); 28 | sessionStorage.setItem('dartdoc-sidebar-left-scrolll' + window.location.pathname, leftSidebar.scrollLeft.toString()); 29 | } 30 | 31 | function saveMainContentScroll() { 32 | const mainContent = document.getElementById('dartdoc-main-content'); 33 | sessionStorage.setItem('dartdoc-main-content-scrollt' + window.location.pathname, mainContent.scrollTop.toString()); 34 | sessionStorage.setItem('dartdoc-main-content-scrolll' + window.location.pathname, mainContent.scrollLeft.toString()); 35 | } 36 | 37 | function saveRightScroll() { 38 | const rightSidebar = document.getElementById('dartdoc-sidebar-right'); 39 | sessionStorage.setItem('dartdoc-sidebar-right-scrollt' + window.location.pathname, rightSidebar.scrollTop.toString()); 40 | sessionStorage.setItem('dartdoc-sidebar-right-scrolll' + window.location.pathname, rightSidebar.scrollLeft.toString()); 41 | } 42 | 43 | function restoreScrolls() { 44 | const leftSidebar = document.getElementById('dartdoc-sidebar-left'); 45 | const mainContent = document.getElementById('dartdoc-main-content'); 46 | const rightSidebar = document.getElementById('dartdoc-sidebar-right'); 47 | 48 | try { 49 | const leftSidebarX = sessionStorage.getItem('dartdoc-sidebar-left-scrolll' + window.location.pathname); 50 | const leftSidebarY = sessionStorage.getItem('dartdoc-sidebar-left-scrollt' + window.location.pathname); 51 | 52 | const mainContentX = sessionStorage.getItem('dartdoc-main-content-scrolll' + window.location.pathname); 53 | const mainContentY = sessionStorage.getItem('dartdoc-main-content-scrollt' + window.location.pathname); 54 | 55 | const rightSidebarX = sessionStorage.getItem('dartdoc-sidebar-right-scrolll' + window.location.pathname); 56 | const rightSidebarY = sessionStorage.getItem('dartdoc-sidebar-right-scrollt' + window.location.pathname); 57 | 58 | leftSidebar.scrollTo(parseFloat(leftSidebarX), parseFloat(leftSidebarY)); 59 | mainContent.scrollTo(parseFloat(mainContentX), parseFloat(mainContentY)); 60 | rightSidebar.scrollTo(parseFloat(rightSidebarX), parseFloat(rightSidebarY)); 61 | } finally { 62 | // Set visibility to visible after scroll to prevent the brief appearance of the 63 | // panel in the wrong position. 64 | leftSidebar.style.visibility = 'visible'; 65 | mainContent.style.visibility = 'visible'; 66 | rightSidebar.style.visibility = 'visible'; 67 | } 68 | } 69 | 70 | function initScrollSave() { 71 | const leftSidebar = document.getElementById('dartdoc-sidebar-left'); 72 | const mainContent = document.getElementById('dartdoc-main-content'); 73 | const rightSidebar = document.getElementById('dartdoc-sidebar-right'); 74 | 75 | leftSidebar.addEventListener("scroll", saveLeftScroll, true); 76 | mainContent.addEventListener("scroll", saveMainContentScroll, true); 77 | rightSidebar.addEventListener("scroll", saveRightScroll, true); 78 | } 79 | 80 | const weights = { 81 | 'library' : 2, 82 | 'class' : 2, 83 | 'mixin' : 3, 84 | 'extension' : 3, 85 | 'typedef' : 3, 86 | 'method' : 4, 87 | 'accessor' : 4, 88 | 'operator' : 4, 89 | 'constant' : 4, 90 | 'property' : 4, 91 | 'constructor' : 4 92 | }; 93 | 94 | function findMatches(index, query) { 95 | if (query === '') { 96 | return []; 97 | } 98 | 99 | const allMatches = []; 100 | 101 | index.forEach(element => { 102 | function score(value) { 103 | value -= element.overriddenDepth * 10; 104 | const weightFactor = weights[element.type] || 4; 105 | allMatches.push({element: element, score: (value / weightFactor) >> 0}); 106 | } 107 | 108 | const name = element.name; 109 | const qualifiedName = element.qualifiedName; 110 | const lowerName = name.toLowerCase(); 111 | const lowerQualifiedName = qualifiedName.toLowerCase(); 112 | const lowerQuery = query.toLowerCase(); 113 | 114 | if (name === query || qualifiedName === query || name === `dart:${query}`) { 115 | score(2000); 116 | } else if (lowerName === `dart:${lowerQuery}`) { 117 | score(1800); 118 | } else if (lowerName === lowerQuery || lowerQualifiedName === lowerQuery) { 119 | score(1700); 120 | } else if (query.length > 1) { 121 | if (name.startsWith(query) || qualifiedName.startsWith(query)) { 122 | score(750); 123 | } else if (lowerName.startsWith(lowerQuery) || lowerQualifiedName.startsWith(lowerQuery)) { 124 | score(650); 125 | } else if (name.includes(query) || qualifiedName.includes(query)) { 126 | score(500); 127 | } else if (lowerName.includes(lowerQuery) || lowerQualifiedName.includes(query)) { 128 | score(400); 129 | } 130 | } 131 | }); 132 | 133 | allMatches.sort((a, b) => { 134 | const x = b.score - a.score; 135 | if (x === 0) { 136 | return a.element.name.length - b.element.name.length; 137 | } 138 | return x; 139 | }); 140 | 141 | const justElements = []; 142 | 143 | for (let i = 0; i < allMatches.length; i++) { 144 | justElements.push(allMatches[i].element); 145 | } 146 | 147 | return justElements; 148 | } 149 | 150 | let baseHref = ''; 151 | 152 | const minLength = 1; 153 | const suggestionLimit = 10; 154 | 155 | function initializeSearch(input, index) { 156 | input.disabled = false; 157 | input.setAttribute('placeholder', 'Search API Docs'); 158 | 159 | // Handle grabbing focus when the users types / outside of the input 160 | document.addEventListener('keypress', (event) => { 161 | if (event.code === 'Slash' && !(document.activeElement instanceof HTMLInputElement)) { 162 | event.preventDefault(); 163 | input.focus(); 164 | } 165 | }); 166 | 167 | // Prepare elements 168 | 169 | const parentForm = input.parentNode; 170 | const wrapper = document.createElement('div'); 171 | wrapper.classList.add('tt-wrapper'); 172 | 173 | parentForm.replaceChild(wrapper, input); 174 | 175 | const inputHint = document.createElement('input'); 176 | inputHint.setAttribute('type', 'text'); 177 | inputHint.setAttribute('autocomplete', 'off'); 178 | inputHint.setAttribute('readonly', 'true'); 179 | inputHint.setAttribute('spellcheck', 'false'); 180 | inputHint.setAttribute('tabindex', '-1'); 181 | inputHint.classList.add('typeahead', 'tt-hint'); 182 | 183 | wrapper.appendChild(inputHint); 184 | 185 | input.setAttribute('autocomplete', 'off'); 186 | input.setAttribute('spellcheck', 'false'); 187 | input.classList.add('tt-input'); 188 | 189 | wrapper.appendChild(input); 190 | 191 | const listBox = document.createElement('div'); 192 | listBox.setAttribute('role', 'listbox'); 193 | listBox.setAttribute('aria-expanded', 'false'); 194 | listBox.style.display = 'none'; 195 | listBox.classList.add('tt-menu'); 196 | 197 | const presentation = document.createElement('div'); 198 | presentation.classList.add('tt-elements'); 199 | 200 | listBox.appendChild(presentation); 201 | 202 | wrapper.appendChild(listBox); 203 | 204 | // Set up various search functionality 205 | 206 | function highlight(text, query) { 207 | query = query.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); 208 | return text.replace(new RegExp(query, 'gi'), (matched) => { 209 | return `${matched}`; 210 | }); 211 | } 212 | 213 | function createSuggestion(query, match) { 214 | const suggestion = document.createElement('div'); 215 | suggestion.setAttribute('data-href', match.href); 216 | suggestion.classList.add('tt-suggestion'); 217 | 218 | const suggestionTitle = document.createElement('span'); 219 | suggestionTitle.classList.add('tt-suggestion-title'); 220 | suggestionTitle.innerHTML = highlight(`${match.name} ${match.type.toLowerCase()}`, query); 221 | 222 | suggestion.appendChild(suggestionTitle); 223 | 224 | if (match.enclosedBy) { 225 | const fromLib = document.createElement('div'); 226 | fromLib.classList.add('search-from-lib'); 227 | fromLib.innerHTML = `from ${highlight(match.enclosedBy.name, query)}`; 228 | 229 | suggestion.appendChild(fromLib); 230 | } 231 | 232 | suggestion.addEventListener('mousedown', event => { 233 | event.preventDefault(); 234 | }); 235 | 236 | suggestion.addEventListener('click', event => { 237 | if (match.href) { 238 | window.location = baseHref + match.href; 239 | event.preventDefault(); 240 | } 241 | }); 242 | 243 | return suggestion; 244 | } 245 | 246 | let storedValue = null; 247 | let actualValue = ''; 248 | let hint = null; 249 | 250 | let suggestionElements = []; 251 | let suggestionsInfo = []; 252 | let selectedElement = null; 253 | 254 | function setHint(value) { 255 | hint = value; 256 | inputHint.value = value || ''; 257 | } 258 | 259 | function updateSuggestions(query, suggestions) { 260 | suggestionsInfo = []; 261 | suggestionElements = []; 262 | presentation.textContent = ''; 263 | 264 | if (suggestions.length < minLength) { 265 | setHint(null) 266 | hideSuggestions(); 267 | return; 268 | } 269 | 270 | for (let i = 0; i < suggestions.length; i++) { 271 | const element = createSuggestion(query, suggestions[i]); 272 | suggestionElements.push(element); 273 | presentation.appendChild(element); 274 | } 275 | 276 | suggestionsInfo = suggestions; 277 | 278 | setHint(query + suggestions[0].name.slice(query.length)); 279 | selectedElement = null; 280 | 281 | showSuggestions(); 282 | } 283 | 284 | function handle(newValue, forceUpdate) { 285 | if (actualValue === newValue && !forceUpdate) { 286 | return; 287 | } 288 | 289 | if (newValue === null || newValue.length === 0) { 290 | updateSuggestions('', []); 291 | return; 292 | } 293 | 294 | const suggestions = findMatches(index, newValue).slice(0, suggestionLimit); 295 | actualValue = newValue; 296 | 297 | updateSuggestions(newValue, suggestions); 298 | } 299 | 300 | function showSuggestions() { 301 | if (presentation.hasChildNodes()) { 302 | listBox.style.display = 'block'; 303 | listBox.setAttribute('aria-expanded', 'true'); 304 | } 305 | } 306 | 307 | function hideSuggestions() { 308 | listBox.style.display = 'none'; 309 | listBox.setAttribute('aria-expanded', 'false'); 310 | } 311 | 312 | // Hook up events 313 | 314 | input.addEventListener('focus', () => { 315 | handle(input.value, true); 316 | }); 317 | 318 | input.addEventListener('blur', () => { 319 | selectedElement = null; 320 | if (storedValue !== null) { 321 | input.value = storedValue; 322 | storedValue = null; 323 | } 324 | hideSuggestions(); 325 | setHint(null); 326 | }); 327 | 328 | input.addEventListener('input', event => { 329 | handle(event.target.value); 330 | }); 331 | 332 | input.addEventListener('keydown', event => { 333 | if (suggestionElements.length === 0) { 334 | return; 335 | } 336 | 337 | if (event.code === 'Enter') { 338 | const selectingElement = selectedElement || 0; 339 | const href = suggestionElements[selectingElement].dataset.href; 340 | if (href) { 341 | window.location = baseHref + href; 342 | } 343 | return; 344 | } 345 | 346 | if (event.code === 'Tab') { 347 | if (selectedElement === null) { 348 | // The user wants to fill the field with the hint 349 | if (hint !== null) { 350 | input.value = hint; 351 | handle(hint); 352 | event.preventDefault(); 353 | } 354 | } else { 355 | // The user wants to fill the input field with their currently selected suggestion 356 | handle(suggestionsInfo[selectedElement].name); 357 | storedValue = null; 358 | selectedElement = null; 359 | event.preventDefault(); 360 | } 361 | return; 362 | } 363 | 364 | const lastIndex = suggestionElements.length - 1; 365 | const previousSelectedElement = selectedElement; 366 | 367 | if (event.code === 'ArrowUp') { 368 | if (selectedElement === null) { 369 | selectedElement = lastIndex; 370 | } else if (selectedElement === 0) { 371 | selectedElement = null; 372 | } else { 373 | selectedElement--; 374 | } 375 | } else if (event.code === 'ArrowDown') { 376 | if (selectedElement === null) { 377 | selectedElement = 0; 378 | } else if (selectedElement === lastIndex) { 379 | selectedElement = null; 380 | } else { 381 | selectedElement++; 382 | } 383 | } else { 384 | if (storedValue !== null) { 385 | storedValue = null; 386 | handle(input.value); 387 | } 388 | return; 389 | } 390 | 391 | if (previousSelectedElement !== null) { 392 | suggestionElements[previousSelectedElement].classList.remove('tt-cursor'); 393 | } 394 | 395 | if (selectedElement !== null) { 396 | const selected = suggestionElements[selectedElement]; 397 | selected.classList.add('tt-cursor'); 398 | 399 | // Guarantee the selected element is visible 400 | if (selectedElement === 0) { 401 | listBox.scrollTop = 0; 402 | } else if (selectedElement === lastIndex) { 403 | listBox.scrollTop = listBox.scrollHeight; 404 | } else { 405 | const offsetTop = selected.offsetTop; 406 | const parentOffsetHeight = listBox.offsetHeight; 407 | if (offsetTop < parentOffsetHeight || parentOffsetHeight < (offsetTop + selected.offsetHeight)) { 408 | selected.scrollIntoView({behavior: 'auto', block: 'nearest'}); 409 | } 410 | } 411 | 412 | if (storedValue === null) { 413 | // Store the actual input value to display their currently selected item 414 | storedValue = input.value; 415 | } 416 | input.value = suggestionsInfo[selectedElement].name; 417 | setHint(''); 418 | } else if (storedValue !== null && previousSelectedElement !== null) { 419 | // They are moving back to the input field, so return the stored value 420 | input.value = storedValue; 421 | setHint(storedValue + suggestionsInfo[0].name.slice(storedValue.length)); 422 | storedValue = null; 423 | } 424 | 425 | event.preventDefault(); 426 | }); 427 | } 428 | 429 | document.addEventListener('DOMContentLoaded', () => { 430 | // Place this first so that unexpected exceptions in other JavaScript do not block page visibility. 431 | restoreScrolls(); 432 | hljs.initHighlightingOnLoad(); 433 | initSideNav(); 434 | initScrollSave(); 435 | 436 | const searchBox = document.getElementById('search-box'); 437 | const searchBody = document.getElementById('search-body'); 438 | const searchSidebar = document.getElementById('search-sidebar'); 439 | 440 | if (document.body.getAttribute('data-using-base-href') === 'false') { 441 | // If dartdoc did not add a base-href tag, we will need to add the relative 442 | // path ourselves. 443 | baseHref = document.body.getAttribute('data-base-href'); 444 | } 445 | 446 | function disableSearch() { 447 | console.log('Could not activate search functionality.'); 448 | if (searchBox) { 449 | searchBox.placeholder = 'Failed to initialize search'; 450 | } 451 | 452 | if (searchBody) { 453 | searchBody.placeholder = 'Failed to initialize search'; 454 | } 455 | 456 | if (searchSidebar) { 457 | searchSidebar.placeholder = 'Failed to initialize search'; 458 | } 459 | } 460 | 461 | if ('fetch' in window) { 462 | fetch(baseHref + 'index.json', {method: 'GET'}) 463 | .then(response => response.json()) 464 | .then(index => { 465 | // Handle if the user specified a `search` parameter in the URL 466 | if ('URLSearchParams' in window) { 467 | const search = new URLSearchParams(window.location.search).get('search'); 468 | if (search) { 469 | const matches = findMatches(search); 470 | if (matches.length !== 0) { 471 | window.location = baseHref + matches[0].href; 472 | return; 473 | } 474 | } 475 | } 476 | 477 | // Initialize all three search fields 478 | if (searchBox) { 479 | initializeSearch(searchBox, index); 480 | } 481 | 482 | if (searchBody) { 483 | initializeSearch(searchBody, index); 484 | } 485 | 486 | if (searchSidebar) { 487 | initializeSearch(searchSidebar, index); 488 | } 489 | }) 490 | .catch(() => { 491 | disableSearch(); 492 | }); 493 | } else { 494 | disableSearch(); 495 | } 496 | }); 497 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | 33 | # Web related 34 | lib/generated_plugin_registrant.dart 35 | 36 | # Exceptions to above rules. 37 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 38 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 18cd7a3601bcffb36fdf2f679f763b5e827c2e8e 8 | channel: beta 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # medcorder_audio_example 2 | 3 | Demonstrates how to use the medcorder_audio plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.example.medcorder_audio_example" 37 | minSdkVersion 16 38 | targetSdkVersion 28 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'androidx.test:runner:1.1.1' 60 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 61 | } 62 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/medcorder_audio_example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.medcorder_audio_example; 2 | 3 | import androidx.annotation.NonNull; 4 | import io.flutter.embedding.android.FlutterActivity; 5 | import io.flutter.embedding.engine.FlutterEngine; 6 | import io.flutter.plugins.GeneratedPluginRegistrant; 7 | 8 | public class MainActivity extends FlutterActivity { 9 | @Override 10 | public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { 11 | GeneratedPluginRegistrant.registerWith(flutterEngine); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.5.0' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def parse_KV_file(file, separator='=') 14 | file_abs_path = File.expand_path(file) 15 | if !File.exists? file_abs_path 16 | return []; 17 | end 18 | generated_key_values = {} 19 | skip_line_start_symbols = ["#", "/"] 20 | File.foreach(file_abs_path) do |line| 21 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } 22 | plugin = line.split(pattern=separator) 23 | if plugin.length == 2 24 | podname = plugin[0].strip() 25 | path = plugin[1].strip() 26 | podpath = File.expand_path("#{path}", file_abs_path) 27 | generated_key_values[podname] = podpath 28 | else 29 | puts "Invalid plugin specification: #{line}" 30 | end 31 | end 32 | generated_key_values 33 | end 34 | 35 | target 'Runner' do 36 | # Flutter Pod 37 | 38 | copied_flutter_dir = File.join(__dir__, 'Flutter') 39 | copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework') 40 | copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec') 41 | unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path) 42 | # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet. 43 | # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration. 44 | # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist. 45 | 46 | generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig') 47 | unless File.exist?(generated_xcode_build_settings_path) 48 | raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first" 49 | end 50 | generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path) 51 | cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR']; 52 | 53 | unless File.exist?(copied_framework_path) 54 | FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir) 55 | end 56 | unless File.exist?(copied_podspec_path) 57 | FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir) 58 | end 59 | end 60 | 61 | # Keep pod path relative so it can be checked into Podfile.lock. 62 | pod 'Flutter', :path => 'Flutter' 63 | 64 | # Plugin Pods 65 | 66 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock 67 | # referring to absolute paths on developers' machines. 68 | system('rm -rf .symlinks') 69 | system('mkdir -p .symlinks/plugins') 70 | plugin_pods = parse_KV_file('../.flutter-plugins') 71 | plugin_pods.each do |name, path| 72 | symlink = File.join('.symlinks', 'plugins', name) 73 | File.symlink(path, symlink) 74 | pod name, :path => File.join(symlink, 'ios') 75 | end 76 | end 77 | 78 | # Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. 79 | install! 'cocoapods', :disable_input_output_paths => true 80 | 81 | post_install do |installer| 82 | installer.pods_project.targets.each do |target| 83 | target.build_configurations.each do |config| 84 | config.build_settings['ENABLE_BITCODE'] = 'NO' 85 | end 86 | end 87 | end 88 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - medcorder_audio (0.0.1): 4 | - Flutter 5 | 6 | DEPENDENCIES: 7 | - Flutter (from `Flutter`) 8 | - medcorder_audio (from `.symlinks/plugins/medcorder_audio/ios`) 9 | 10 | EXTERNAL SOURCES: 11 | Flutter: 12 | :path: Flutter 13 | medcorder_audio: 14 | :path: ".symlinks/plugins/medcorder_audio/ios" 15 | 16 | SPEC CHECKSUMS: 17 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec 18 | medcorder_audio: 39016cfc6d8d7eded898ef88dc56984496c7b017 19 | 20 | PODFILE CHECKSUM: 3dbe063e9c90a5d7c9e4e76e70a821b9e2c1d271 21 | 22 | COCOAPODS: 1.8.4 23 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | #import "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | medcorder_audio_example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:medcorder_audio/medcorder_audio.dart'; 5 | 6 | void main() { 7 | runApp(new MyApp()); 8 | } 9 | 10 | class MyApp extends StatefulWidget { 11 | @override 12 | _MyAppState createState() => new _MyAppState(); 13 | } 14 | 15 | class _MyAppState extends State { 16 | MedcorderAudio audioModule = new MedcorderAudio(); 17 | bool canRecord = false; 18 | double recordPower = 0.0; 19 | double recordPosition = 0.0; 20 | bool isRecord = false; 21 | bool isPlay = false; 22 | double playPosition = 0.0; 23 | String file = ""; 24 | 25 | @override 26 | initState() { 27 | super.initState(); 28 | audioModule.setCallBack((dynamic data) { 29 | _onEvent(data); 30 | }); 31 | _initSettings(); 32 | } 33 | 34 | Future _initSettings() async { 35 | final String result = await audioModule.checkMicrophonePermissions(); 36 | if (result == 'OK') { 37 | await audioModule.setAudioSettings(); 38 | setState(() { 39 | canRecord = true; 40 | }); 41 | } 42 | return; 43 | } 44 | 45 | Future _startRecord() async { 46 | try { 47 | DateTime time = new DateTime.now(); 48 | setState(() { 49 | file = time.millisecondsSinceEpoch.toString(); 50 | }); 51 | final String result = await audioModule.startRecord(file); 52 | setState(() { 53 | isRecord = true; 54 | }); 55 | print('startRecord: ' + result); 56 | } catch (e) { 57 | file = ""; 58 | print('startRecord: fail'); 59 | } 60 | } 61 | 62 | Future _stopRecord() async { 63 | try { 64 | final String result = await audioModule.stopRecord(); 65 | print('stopRecord: ' + result); 66 | setState(() { 67 | isRecord = false; 68 | }); 69 | } catch (e) { 70 | print('stopRecord: fail'); 71 | setState(() { 72 | isRecord = false; 73 | }); 74 | } 75 | } 76 | 77 | Future _startStopPlay() async { 78 | if (isPlay) { 79 | await audioModule.stopPlay(); 80 | } else { 81 | await audioModule.startPlay({ 82 | "file": file, 83 | "position": 0.0, 84 | }); 85 | } 86 | } 87 | 88 | void _onEvent(dynamic event) { 89 | if (event['code'] == 'recording') { 90 | double power = event['peakPowerForChannel']; 91 | setState(() { 92 | recordPower = (60.0 - power.abs().floor()).abs(); 93 | recordPosition = event['currentTime']; 94 | }); 95 | } 96 | if (event['code'] == 'playing') { 97 | String url = event['url']; 98 | setState(() { 99 | playPosition = event['currentTime']; 100 | isPlay = true; 101 | }); 102 | } 103 | if (event['code'] == 'audioPlayerDidFinishPlaying') { 104 | setState(() { 105 | playPosition = 0.0; 106 | isPlay = false; 107 | }); 108 | } 109 | } 110 | 111 | @override 112 | Widget build(BuildContext context) { 113 | return new MaterialApp( 114 | home: new Scaffold( 115 | appBar: new AppBar( 116 | title: new Text('Audio example app'), 117 | ), 118 | body: new Center( 119 | child: canRecord 120 | ? new Column( 121 | mainAxisAlignment: MainAxisAlignment.center, 122 | crossAxisAlignment: CrossAxisAlignment.center, 123 | children: [ 124 | new InkWell( 125 | child: new Container( 126 | alignment: FractionalOffset.center, 127 | child: new Text(isRecord ? 'Stop' : 'Record'), 128 | height: 40.0, 129 | width: 200.0, 130 | color: Colors.blue, 131 | ), 132 | onTap: () { 133 | if (isRecord) { 134 | _stopRecord(); 135 | } else { 136 | _startRecord(); 137 | } 138 | }, 139 | ), 140 | new Text('recording: ' + recordPosition.toString()), 141 | new Text('power: ' + recordPower.toString()), 142 | new InkWell( 143 | child: new Container( 144 | margin: new EdgeInsets.only(top: 40.0), 145 | alignment: FractionalOffset.center, 146 | child: new Text(isPlay ? 'Stop' : 'Play'), 147 | height: 40.0, 148 | width: 200.0, 149 | color: Colors.blue, 150 | ), 151 | onTap: () { 152 | if (!isRecord && file.length > 0) { 153 | _startStopPlay(); 154 | } 155 | }, 156 | ), 157 | new Text('playing: ' + playPosition.toString()), 158 | ], 159 | ) 160 | : new Text( 161 | 'Microphone Access Disabled.\nYou can enable access in Settings', 162 | textAlign: TextAlign.center, 163 | ), 164 | ), 165 | ), 166 | ); 167 | } 168 | } 169 | -------------------------------------------------------------------------------- /example/medcorder_audio_example.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: medcorder_audio_example 2 | description: Demonstrates how to use the medcorder_audio plugin. 3 | publish_to: 'none' 4 | 5 | environment: 6 | sdk: ">=2.1.0 <3.0.0" 7 | 8 | dependencies: 9 | flutter: 10 | sdk: flutter 11 | 12 | # The following adds the Cupertino Icons font to your application. 13 | # Use with the CupertinoIcons class for iOS style icons. 14 | cupertino_icons: ^0.1.2 15 | 16 | dev_dependencies: 17 | flutter_test: 18 | sdk: flutter 19 | 20 | medcorder_audio: 21 | path: ../ 22 | 23 | # For information on the generic Dart part of this file, see the 24 | # following page: https://dart.dev/tools/pub/pubspec 25 | 26 | # The following section is specific to Flutter. 27 | flutter: 28 | 29 | # The following line ensures that the Material Icons font is 30 | # included with your application, so that you can use the icons in 31 | # the material Icons class. 32 | uses-material-design: true 33 | 34 | # To add assets to your application, add an assets section, like this: 35 | # assets: 36 | # - images/a_dot_burr.jpeg 37 | # - images/a_dot_ham.jpeg 38 | 39 | # An image asset can refer to one or more resolution-specific "variants", see 40 | # https://flutter.dev/assets-and-images/#resolution-aware. 41 | 42 | # For details regarding adding assets from package dependencies, see 43 | # https://flutter.dev/assets-and-images/#from-packages 44 | 45 | # To add custom fonts to your application, add a fonts section here, 46 | # in this "flutter" section. Each entry in this list should have a 47 | # "family" key with the font family name, and a "fonts" key with a 48 | # list giving the asset and other descriptors for the font. For 49 | # example: 50 | # fonts: 51 | # - family: Schyler 52 | # fonts: 53 | # - asset: fonts/Schyler-Regular.ttf 54 | # - asset: fonts/Schyler-Italic.ttf 55 | # style: italic 56 | # - family: Trajan Pro 57 | # fonts: 58 | # - asset: fonts/TrajanPro.ttf 59 | # - asset: fonts/TrajanPro_Bold.ttf 60 | # weight: 700 61 | # 62 | # For details regarding fonts from package dependencies, 63 | # see https://flutter.dev/custom-fonts/#from-packages 64 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | /* 9 | import 'package:flutter/material.dart'; 10 | import 'package:flutter_test/flutter_test.dart'; 11 | 12 | import 'package:medcorder_audio_example/main.dart'; 13 | 14 | void main() { 15 | testWidgets('Verify Platform version', (WidgetTester tester) async { 16 | // Build our app and trigger a frame. 17 | await tester.pumpWidget(MyApp()); 18 | 19 | // Verify that platform version is retrieved. 20 | expect( 21 | find.byWidgetPredicate( 22 | (Widget widget) => widget is Text && 23 | widget.data.startsWith('Running on:'), 24 | ), 25 | findsOneWidget, 26 | ); 27 | }); 28 | } 29 | */ 30 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/flutter_export_environment.sh -------------------------------------------------------------------------------- /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evrone/flutter_audio/b5b45e72a4ba8c31952d9517326b3e865a164d06/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /ios/Classes/MedcorderAudioPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface MedcorderAudioPlugin : NSObject 4 | @end 5 | -------------------------------------------------------------------------------- /ios/Classes/MedcorderAudioPlugin.m: -------------------------------------------------------------------------------- 1 | #import "MedcorderAudioPlugin.h" 2 | 3 | @implementation MedcorderAudioPlugin 4 | + (void)registerWithRegistrar:(NSObject*)registrar { 5 | FlutterMethodChannel* channel = [FlutterMethodChannel 6 | methodChannelWithName:@"medcorder_audio" 7 | binaryMessenger:[registrar messenger]]; 8 | MedcorderAudioPlugin* instance = [[MedcorderAudioPlugin alloc] init]; 9 | [registrar addMethodCallDelegate:instance channel:channel]; 10 | } 11 | 12 | - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { 13 | if ([@"getPlatformVersion" isEqualToString:call.method]) { 14 | result([@"iOS " stringByAppendingString:[[UIDevice currentDevice] systemVersion]]); 15 | } else { 16 | result(FlutterMethodNotImplemented); 17 | } 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /ios/medcorder_audio.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. 3 | # Run `pod lib lint medcorder_audio.podspec' to validate before publishing. 4 | # 5 | Pod::Spec.new do |s| 6 | s.name = 'medcorder_audio' 7 | s.version = '0.0.1' 8 | s.summary = 'A new flutter plugin project.' 9 | s.description = <<-DESC 10 | A new flutter plugin project. 11 | DESC 12 | s.homepage = 'http://example.com' 13 | s.license = { :file => '../LICENSE' } 14 | s.author = { 'Your Company' => 'email@example.com' } 15 | s.source = { :path => '.' } 16 | s.source_files = 'Classes/**/*' 17 | s.public_header_files = 'Classes/**/*.h' 18 | s.dependency 'Flutter' 19 | s.platform = :ios, '8.0' 20 | 21 | # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. 22 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } 23 | end 24 | -------------------------------------------------------------------------------- /lib/medcorder_audio.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:flutter/services.dart'; 3 | 4 | class MedcorderAudio { 5 | static const MethodChannel platform = const MethodChannel('medcorder_audio'); 6 | 7 | static const EventChannel eventChannel = 8 | const EventChannel('medcorder_audio_events'); 9 | 10 | dynamic callback; 11 | 12 | MedcorderAudio() { 13 | eventChannel.receiveBroadcastStream().listen(_onEvent, onError: _onError); 14 | } 15 | 16 | void setCallBack(dynamic _callback) { 17 | callback = _callback; 18 | } 19 | 20 | Future setAudioSettings() async { 21 | try { 22 | final String result = await platform.invokeMethod('setAudioSettings'); 23 | print('setAudioSettings: ' + result); 24 | return result; 25 | } catch (e) { 26 | print('setAudioSettings: fail'); 27 | return 'fail'; 28 | } 29 | } 30 | 31 | Future backAudioSettings() async { 32 | try { 33 | final String result = await platform.invokeMethod('backAudioSettings'); 34 | print('backAudioSettings: ' + result); 35 | return result; 36 | } catch (e) { 37 | print('backAudioSettings: fail'); 38 | return 'fail'; 39 | } 40 | } 41 | 42 | Future startRecord(String file) async { 43 | try { 44 | final String result = await platform.invokeMethod('startRecord', file); 45 | print('startRecord: ' + result); 46 | return result; 47 | } catch (e) { 48 | print('startRecord: fail'); 49 | return 'fail'; 50 | } 51 | } 52 | 53 | Future stopRecord() async { 54 | try { 55 | final String result = await platform.invokeMethod('stopRecord'); 56 | print('stopRecord: ' + result); 57 | return result; 58 | } catch (e) { 59 | print('stopRecord: fail'); 60 | return 'fail'; 61 | } 62 | } 63 | 64 | Future checkMicrophonePermissions() async { 65 | try { 66 | final String result = 67 | await platform.invokeMethod('checkMicrophonePermissions'); 68 | print('stopPlay: ' + result); 69 | return result; 70 | } catch (e) { 71 | print('stopPlay: fail'); 72 | return 'fail'; 73 | } 74 | } 75 | 76 | Future startPlay(dynamic params) async { 77 | try { 78 | final String result = await platform.invokeMethod('startPlay', params); 79 | print('startPlay: ' + result); 80 | return result; 81 | } catch (e) { 82 | print('startPlay: fail'); 83 | return 'fail'; 84 | } 85 | } 86 | 87 | Future stopPlay() async { 88 | try { 89 | final String result = await platform.invokeMethod('stopPlay'); 90 | print('stopPlay: ' + result); 91 | return result; 92 | } catch (e) { 93 | print('stopPlay: fail'); 94 | return 'fail'; 95 | } 96 | } 97 | 98 | void _onEvent(dynamic event) { 99 | callback(event); 100 | } 101 | 102 | void _onError(dynamic error) { 103 | print('CHannel Error'); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /medcorder_audio.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: medcorder_audio 2 | description: Flutter audio record/play plugin. With medcorder_audio plugin you can integrate record/play audio support into your flutter app for iOS or Android. 3 | version: 0.0.7 4 | homepage: https://github.com/evrone/flutter_audio 5 | 6 | environment: 7 | sdk: ">=2.1.0 <3.0.0" 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | 13 | dev_dependencies: 14 | flutter_test: 15 | sdk: flutter 16 | 17 | # For information on the generic Dart part of this file, see the 18 | # following page: https://dart.dev/tools/pub/pubspec 19 | 20 | # The following section is specific to Flutter. 21 | flutter: 22 | # This section identifies this Flutter project as a plugin project. 23 | # The androidPackage and pluginClass identifiers should not ordinarily 24 | # be modified. They are used by the tooling to maintain consistency when 25 | # adding or updating assets for this project. 26 | plugin: 27 | androidPackage: co.medcorder.medcorderaudio 28 | pluginClass: MedcorderAudioPlugin 29 | 30 | # To add assets to your plugin package, add an assets section, like this: 31 | # assets: 32 | # - images/a_dot_burr.jpeg 33 | # - images/a_dot_ham.jpeg 34 | # 35 | # For details regarding assets in packages, see 36 | # https://flutter.dev/assets-and-images/#from-packages 37 | # 38 | # An image asset can refer to one or more resolution-specific "variants", see 39 | # https://flutter.dev/assets-and-images/#resolution-aware. 40 | 41 | # To add custom fonts to your plugin package, add a fonts section here, 42 | # in this "flutter" section. Each entry in this list should have a 43 | # "family" key with the font family name, and a "fonts" key with a 44 | # list giving the asset and other descriptors for the font. For 45 | # example: 46 | # fonts: 47 | # - family: Schyler 48 | # fonts: 49 | # - asset: fonts/Schyler-Regular.ttf 50 | # - asset: fonts/Schyler-Italic.ttf 51 | # style: italic 52 | # - family: Trajan Pro 53 | # fonts: 54 | # - asset: fonts/TrajanPro.ttf 55 | # - asset: fonts/TrajanPro_Bold.ttf 56 | # weight: 700 57 | # 58 | # For details regarding fonts in packages, see 59 | # https://flutter.dev/custom-fonts/#from-packages 60 | -------------------------------------------------------------------------------- /test/medcorder_audio_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:medcorder_audio/medcorder_audio.dart'; 4 | 5 | void main() { 6 | const MethodChannel channel = MethodChannel('medcorder_audio'); 7 | 8 | TestWidgetsFlutterBinding.ensureInitialized(); 9 | 10 | setUp(() { 11 | channel.setMockMethodCallHandler((MethodCall methodCall) async { 12 | return '42'; 13 | }); 14 | }); 15 | 16 | tearDown(() { 17 | channel.setMockMethodCallHandler(null); 18 | }); 19 | 20 | /* 21 | test('getPlatformVersion', () async { 22 | expect(await MedcorderAudio.platformVersion, '42'); 23 | }); 24 | */ 25 | } 26 | --------------------------------------------------------------------------------