hyochan / react-native-audio-recorder-player

react-native native module for audio recorder and player.
MIT License
709 stars 212 forks source link

iOS Sending `rn-recordback` with no listeners registered. stop record not working #291

Closed hufans closed 3 years ago

hufans commented 3 years ago

Please use the

react-native-audio-recorder-player @3.0.0 release

android work fine ,iOS bad work ,(device : my iphone, record permission fine )

when Start record rn-recordback with no listeners registered Warnings per second ,then Stop record ,Error: Faled to stop recorder

[Mon May 10 2021 16:38:00.330] LOG file:///var/mobile/Containers/Data/Application/401C1F9B-8F21-4A52-9D45-BA3E2D/Library/Caches/sound.m4a ===================start

[Mon May 10 2021 16:38:00.912] WARN Sending rn-recordback with no listeners registered. [Mon May 10 2021 16:38:01.332] WARN Sending rn-recordback with no listeners registered. [Mon May 10 2021 16:38:01.838] WARN Sending rn-recordback with no listeners registered. [Mon May 10 2021 16:38:02.260] GROUPCOLLAPSED .. %c action %cLocationActions/locationLive %c@ 16:38:01.987 color: gray; font-weight: lighter; color: inherit; color: gray; font-weight: lighter; (viewable in debugger) [Mon May 10 2021 16:38:02.335] WARN Sending rn-recordback with no listeners registered. [Mon May 10 2021 16:38:02.863] WARN Sending rn-recordback with no listeners registered. [Mon May 10 2021 16:38:03.375] GROUPCOLLAPSED .. %c action %cLocationActions/locationLive %c@ 16:38:03.654 color: gray; font-weight: lighter; color: inherit; color: gray; font-weight: lighter; (viewable in debugger) [Mon May 10 2021 16:38:03.830] WARN Sending rn-recordback with no listeners registered. [Mon May 10 2021 16:38:04.418] WARN Sending rn-recordback with no listeners registered. [Mon May 10 2021 16:38:04.846] WARN Sending rn-recordback with no listeners registered. [Mon May 10 2021 16:38:05.353] WARN Sending rn-recordback with no listeners registered. [Mon May 10 2021 16:38:05.837] WARN Sending rn-recordback with no listeners registered. [Mon May 10 2021 16:38:06.338] WARN Sending rn-recordback with no listeners registered. [Mon May 10 2021 16:38:06.878] WARN Sending rn-recordback with no listeners registered. [Mon May 10 2021 16:38:06.959] GROUPCOLLAPSED .. %c action %cSystemActionTypes/OnNetworkStateChange %c@ 16:38:06.905 color: gray; font-weight: lighter; color: inherit; color: gray; font-weight: lighter; (viewable in debugger) [Mon May 10 2021 16:38:07.339] WARN Sending rn-recordback with no listeners registered. [Mon May 10 2021 16:38:07.421] WARN Possible Unhandled Promise Rejection (id: 0): Error: Faled to stop recorder promiseMethodWrapper@http://192.168.50.225:8081/index.bundle?platform=ios&dev=true&minify=false:2277:45

hyochan commented 3 years ago

Hey there. Have you checked our Example project and compared it to yours?

hufans commented 3 years ago

@hyochan rn-recordback with no listeners registered. Has been resolved, stop recrod still error

Listeners registered issue from /**

according this comments with typescirpt lint Check code should be

current.addRecordBackListener = (e: RecordBackType) => { console.log(e.currentMetering); };

so I got error;

this line should be

addRecordBackListener(e: (e: RecordBackType) => void): void

hufans commented 3 years ago

I got error with this line

WeChat1d3b955e1ae39154eca06e81d41b642f
hyochan commented 3 years ago

I got error with this line

WeChat1d3b955e1ae39154eca06e81d41b642f

Please open up another issue if you want to start the new thread.

Also try to use try and catch statement in this case.

milesscherrer commented 3 years ago

@hufans Also have this issue in release and dev, simulator and real device (3.0.2). Sorry not following the conversation here is there a solution?

yzaguirre commented 2 years ago

After the startRecorder call, add an empty record listener. Like this:

this.audioRecorderPlayer.addRecordBackListener((e) => {})

En when stopRecorder is called, do remove the listener:

this.audioRecorderPlayer.removeRecordBackListener()

Worked for me. I don't use that listener while recording, but iOS needs it.

NoahSimajji commented 1 month ago

After the startRecorder call, add an empty record listener. Like this:

this.audioRecorderPlayer.addRecordBackListener((e) => {})

En when stopRecorder is called, do remove the listener:

this.audioRecorderPlayer.removeRecordBackListener()

Worked for me. I don't use that listener while recording, but iOS needs it.

Thanks, this is working