Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The operation couldn’t be completed. (HaishinKit.IORecorder.Error error 3.) #1299

Open
mkrn opened this issue Sep 22, 2023 · 2 comments
Open

Comments

@mkrn
Copy link

mkrn commented Sep 22, 2023

Describe the bug

Sometimes if the stream getting trouble connecting in the end I get the
The operation couldn’t be completed. (HaishinKit.IORecorder.Error error 3.)
Is there any reason or a

To Reproduce

Unfortunately no steps, but this usually happens when there's issue with connecting on 4g / multiple reconnects

Expected behavior

Recording to always save no matter what

Version

master

Smartphone info.

Apple iPhone 12 Pro Max

Additional context

No response

Screenshots

No response

Relevant log output

No response

@shogo4405
Copy link
Owner

I want to know the content of the error message. You can see the content inside Error.Domain with print(error).

  1. This commonly occurs when the microphone is detached, and the app is in the background for 30 seconds or more, especially when the Control Center is open for 30 seconds or longer. This can lead to recording failures.

    failedToFinishWriting(error: Optional(Error Domain=AVFoundationErrorDomain Code=-11847 "Operation Interrupted" UserInfo={NSLocalizedRecoverySuggestion=Stop other operations and try again., NSLocalizedDescription=Operation Interrupted, NSUnderlyingError=0x2815224c0 {Error Domain=NSOSStatusErrorDomain Code=-16121 "(null)"}}))

  2. When you specify recorder.startRecording([.audio: [], .video: []]) and either the video or audio is missing, recording will fail. The error message in this case is as follows:

    failedToFinishWriting(error: nil)

@mkrn
Copy link
Author

mkrn commented Sep 26, 2023

Apparently here's what happened:
Swipe to left to other app => app goes to background => sessionWasInterrupted => stop recording
While my app was in background, sessionInterruptionEnded called => started streaming & recording
...something empty recorded,
returned to foreground...
stop recording=> error nil

I fixed the logic in my app, but FYI recording error may happen if recording was running in the background.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants