Canardoux / flutter_sound

Flutter plugin for sound. Audio recorder and player.
Mozilla Public License 2.0
877 stars 573 forks source link

Exception on replaying #82

Closed mirkancal closed 4 years ago

mirkancal commented 5 years ago

Version of flutter_sound

1.4.0

flutter doctor

➜ flutter doctor -v
[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Linux, locale en_US.UTF-8)
    • Flutter version 1.5.4-hotfix.2 at /home/mirkan/development/flutter
    • Framework revision 7a4c33425d (9 days ago), 2019-04-29 11:05:24 -0700
    • Engine revision 52c7a1e849
    • Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /home/mirkan/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /home/mirkan/Android/Sdk
    • Java binary at: /opt/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_152-release-1343-b16-5323222)
    • All Android licenses accepted.

[✓] Android Studio (version 3.4)
    • Android Studio at /opt/android-studio
    • Flutter plugin version 35.2.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build
      1.8.0_152-release-1343-b16-5323222)

[✓] IntelliJ IDEA Ultimate Edition (version 2019.1)
    • IntelliJ at /opt/idea-IU-183.4284.148
    • Flutter plugin version 35.2.3
    • Dart plugin version 191.7019

[✓] VS Code (version 1.33.1)
    • VS Code at /usr/share/code
    • Flutter extension version 3.0.0

[✓] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API
      28) (emulator)

• No issues found!

Platforms you faced the error (IOS or Android or both?)

Android

Expected behavior

Resume playing the recording

Actual behavior

Paused on exception

Tested environment (Emulator? Real Device?)

Emulator Nexus 5

Steps to reproduce the behavior

It's the example app in the plugin.

Debug Console

Restarted application in 1,864ms.
D/FlutterSoundPlugin( 5860): startRecorder
I/flutter ( 5860): startRecorder: /storage/emulated/0/default.m4a
I/flutter ( 5860): got update -> 0.0
I/flutter ( 5860): got update -> 0.0
I/flutter ( 5860): got update -> 0.0
I/flutter ( 5860): got update -> 0.0
I/flutter ( 5860): got update -> 0.0
I/flutter ( 5860): got update -> 0.0
I/flutter ( 5860): got update -> 0.0
I/flutter ( 5860): stopRecorder: recorder stopped.
D/FlutterSoundPlugin( 5860): mediaPlayer prepared and start
I/flutter ( 5860): result: /storage/emulated/0/default.m4a
I/flutter ( 5860): startPlayer: /storage/emulated/0/default.m4a
I/flutter ( 5860): pausePlayer: paused player.
I/flutter ( 5860): result: player resumed.
D/FlutterSoundPlugin( 5860): Plays completed.
V/MediaPlayer( 5860): resetDrmState:  mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
V/MediaPlayer( 5860): cleanDrmObj: mDrmObj=null mDrmSessionId=null
W/MediaPlayer( 5860): mediaplayer went away with unhandled events

Problem

I'm recording an audio, and then play it. When I pause and replay it, it causes an exception.

hyochan commented 5 years ago

Try to stop it first then record again. Currently, you should release recorder before recording again.

jslyonnais commented 5 years ago

Have the got update -> 0.0 problem too. Also with the demo.

edit: it's seems like the Android emulator can't record audio. Try build an apk and test on your device (or connect it trough USB, with debug mode activated and it try it with your cellphone :) Works fine for me!

github-actions[bot] commented 4 years ago

This issue is stale because it has been open 90 days with no activity. Leave a comment or this will be closed in 7 days.