Comments (3)
To make matters worse, you cannot stop the recording after is error was thrown. Also, await AudioRecorder.isRecording
stays returning true
.
If you try to call AudioRecorder.stop()
again:
D/AudioRecorder(13610): Stop
E/MediaRecorder(13610): stop called in an invalid state: 0
E/MethodChannel#audio_recorder(13610): Failed to handle method call
E/MethodChannel#audio_recorder(13610): java.lang.IllegalStateException
E/MethodChannel#audio_recorder(13610): at android.media.MediaRecorder.stop(Native Method)
E/MethodChannel#audio_recorder(13610): at com.jordanalcaraz.audiorecorder.audiorecorder.AudioRecorderPlugin.stopNormalRecording(AudioRecorderPlugin.java:134)
E/MethodChannel#audio_recorder(13610): at com.jordanalcaraz.audiorecorder.audiorecorder.AudioRecorderPlugin.stopRecording(AudioRecorderPlugin.java:128)
E/MethodChannel#audio_recorder(13610): at com.jordanalcaraz.audiorecorder.audiorecorder.AudioRecorderPlugin.onMethodCall(AudioRecorderPlugin.java:66)
E/MethodChannel#audio_recorder(13610): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:222)
E/MethodChannel#audio_recorder(13610): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96)
E/MethodChannel#audio_recorder(13610): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:643)
E/MethodChannel#audio_recorder(13610): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#audio_recorder(13610): at android.os.MessageQueue.next(MessageQueue.java:325)
E/MethodChannel#audio_recorder(13610): at android.os.Looper.loop(Looper.java:142)
E/MethodChannel#audio_recorder(13610): at android.app.ActivityThread.main(ActivityThread.java:6494)
E/MethodChannel#audio_recorder(13610): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#audio_recorder(13610): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
E/MethodChannel#audio_recorder(13610): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
E/flutter (13610): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(error, null, null)
E/flutter (13610): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7)
E/flutter (13610): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:316:33)
E/flutter (13610): <asynchronous suspension>
E/flutter (13610): #2 AudioRecorder.stop (package:audio_recorder/audio_recorder.dart:49:33)
E/flutter (13610): <asynchronous suspension>
E/flutter (13610): #3 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:635:14)
E/flutter (13610): #4 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:711:32)
E/flutter (13610): #5 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
E/flutter (13610): #6 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:365:11)
E/flutter (13610): #7 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:275:7)
E/flutter (13610): #8 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:455:9)
E/flutter (13610): #9 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:75:13)
E/flutter (13610): #10 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:102:11)
E/flutter (13610): #11 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19)
E/flutter (13610): #12 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
E/flutter (13610): #13 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter (13610): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter (13610): #15 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter (13610): #16 _rootRunUnary (dart:async/zone.dart:1136:13)
E/flutter (13610): #17 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
E/flutter (13610): #18 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
E/flutter (13610): #19 _invoke1 (dart:ui/hooks.dart:250:10)
E/flutter (13610): #20 _dispatchPointerDataPacket (dart:ui/hooks.dart:159:5)
from audio_recorder.
may cause by stop() is called immediately after start()... i tried `` try {
mRecorder.stop();
mRecorder.reset();
mRecorder.release();
mRecorder = null;
}catch (RuntimeException e){
}` ``
Is there a better way?
from audio_recorder.
it seems it is a bug. here facing with the same issue!
from audio_recorder.
Related Issues (20)
- Exception miss kotlin files HOT 11
- Can't play audio recorded on android, send to server , and received from on iOS HOT 1
- Build failed in example app HOT 3
- Audio quality
- Flutter1.12.13 build has problem HOT 1
- problem, pleasse solution
- compiler error: HOT 3
- doesn't return proper audio file on iOS HOT 3
- 1.7.3 Flutter run on IOS error HOT 13
- Size : Zero octets
- Missing License in Flutters showAboutDialog
- SwiftAudioRecorderPlugin.swift build issues HOT 2
- This package needs to be updated to file: ^6.0.0-nullsafety.2 HOT 4
- Is this project abandoned??
- audio_recorder: 1.0.2 ios build error HOT 3
- Getting error 'MediaRecorder: start called in an invalid state: 4' HOT 2
- Header 'audio_recorder-Swift.h' not found
- null safety HOT 2
- can i use this on WEB ? when i get error "No implementation found for method hasPermissions on channel audio_recorder"
- MissingPluginException(No implementation found for method start on channel audio_recorder) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from audio_recorder.