Canardoux / flutter_sound

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

[BUG] Muting OFF on Android #583

Open efraespada opened 3 years ago

efraespada commented 3 years ago

Flutter Sound Version :

Severity

Platforms you faced the error

Logs

When recording:

I/AudioManager(29542): In stopBluetoothSco(), calling application: com.landa.app
I/AudioManager(29542): In setBluetoothScoOn(), on: false, calling application: com.landa.app
I/AudioManager(29542): In setSpeakerphoneOn(), on: true, calling application: com.landa.app
I/AudioManager(29542): In setSpeakerphoneOn(), on: true, calling application: com.landa.app
I/AudioManager(29542): In setBluetoothScoOn(), on: false, calling application: com.landa.app
I/AudioManager(29542): In stopBluetoothSco(), calling application: com.landa.app

When playing the sound:

I/flutter (29542): FS:---> openAudioSession 
I/AudioManager(29542): In stopBluetoothSco(), calling application: com.landa.app
I/AudioManager(29542): In setBluetoothScoOn(), on: false, calling application: com.landa.app
I/AudioManager(29542): In setSpeakerphoneOn(), on: true, calling application: com.landa.app
I/AudioManager(29542): In setSpeakerphoneOn(), on: true, calling application: com.landa.app
I/AudioManager(29542): In setBluetoothScoOn(), on: false, calling application: com.landa.app
I/AudioManager(29542): In stopBluetoothSco(), calling application: com.landa.app
I/flutter (29542): FS:---> channelMethodCallHandler : openAudioSessionCompleted
I/flutter (29542): FS:<--- channelMethodCallHandler : openAudioSessionCompleted
I/flutter (29542): FS:<--- openAudioSession 
I/flutter (29542): FS:---> setSubscriptionDuration 
I/flutter (29542): FS:<---- setSubscriptionDuration 
I/flutter (29542): FS:---> startPlayer 
I/flutter (29542): FS:---> stop 
I/flutter (29542): FS:<--- stop 
I/flutter (29542): FS:---> _convert 
I/flutter (29542): FS:---> needToConvert 
I/flutter (29542): FS:<--- needToConvert 
I/flutter (29542): FS:<--- _convert 
I/flutter (29542): FS:<--- startPlayer 
D/FlautoPlayer(29542): mediaPlayer prepared and started
I/flutter (29542): FS:---> channelMethodCallHandler : startPlayerCompleted
I/flutter (29542): FS:<--- channelMethodCallHandler : startPlayerCompleted
I/flutter (29542): audioPlayerListener 0:00:00.000000 0:00:02.560000
I/flutter (29542): audioPlayerListener 0:00:00.345000 0:00:02.560000
I/flutter (29542): audioPlayerListener 0:00:00.846000 0:00:02.560000
I/flutter (29542): audioPlayerListener 0:00:01.348000 0:00:02.560000
I/flutter (29542): audioPlayerListener 0:00:01.849000 0:00:02.560000
I/flutter (29542): audioPlayerListener 0:00:02.349000 0:00:02.560000
D/FlautoPlayer(29542): Playback completed.
V/MediaPlayer(29542): resetDrmState:  mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
V/MediaPlayer(29542): cleanDrmObj: mDrmObj=null mDrmSessionId=null
V/MediaPlayer(29542): resetDrmState:  mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
V/MediaPlayer(29542): cleanDrmObj: mDrmObj=null mDrmSessionId=null
I/flutter (29542): FS:---> channelMethodCallHandler : audioPlayerFinishedPlaying
I/flutter (29542): FS:---> audioPlayerFinished
I/flutter (29542): FS:---> stopPlayer 
I/flutter (29542): FS:---> stop 
I/flutter (29542): FS:---> closeAudioSession 
I/flutter (29542): FS:---> stop 
I/flutter (29542): FS:<--- audioPlayerFinished
I/flutter (29542): FS:<--- channelMethodCallHandler : audioPlayerFinishedPlaying
I/flutter (29542): FS:<--- stop 
I/flutter (29542): FS:<--- stopPlayer 
I/flutter (29542): FS:<--- stop 
I/flutter (29542): FS:<--- closeAudioSession 

Describe the bug Some Android devices record as expected but when playing this record file, no sound is heard. If I try to play this record file on other devices, there is no sound either.

Additional context**

This problem is faced in a BQ X2. Moto G9 works fine. No problem found in iOS.

Larpoux commented 3 years ago

Of course, it will be great if one day you post a Pull Request with necessary changes. I will stop everything to merge your PR in the master branch.

efraespada commented 3 years ago

Well, I realized where is the problem (in my application). Your comment about the mute state was the trick.

My app can do VoIP calls. If I mute the microphone when calling, the record I do later is blank.

You are completely right with that:

The minimum I will do, will be to add this instruction to Mute OFF.

My fault 😓

Larpoux commented 3 years ago

May I ask you to click "thumb up" on the pub.dev page if you did not do it already ?

Take care Efra. And come back if other problems ...

efraespada commented 3 years ago

Of course, done! And trying to send a Paypal tip for a super coffee (not sure if it worked, I'll review again in hours 😄).

Thank you very much!

github-actions[bot] commented 11 months 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.