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

iOS: Conflict with other AVAudio player/recorder applications #30

Open
ncstc1 opened this issue Dec 6, 2022 · 0 comments
Open

iOS: Conflict with other AVAudio player/recorder applications #30

ncstc1 opened this issue Dec 6, 2022 · 0 comments

Comments

@ncstc1
Copy link

ncstc1 commented Dec 6, 2022

Hi, I have two questions/comments on iOS:

Conflicts between AVAudio callers

It looks like AVAudioRecorder processing will stop (isRecording becomes false) if another application starts playing music.

Is there a way to avoid that? (by tweaking the current code or using another API? I am not sure another API returns metering information/averagePowerForChannel).

Making the timer collection more robust

When the application resumes after the previous problem, the metering processing should resume too (isRecording should become true again).

I am unsure about the right fix (hence no PR :)) but I considered something like:

(void)sendProgressUpdate {
  if (!_audioRecorder || !_audioRecorder.isRecording) {
    if (!_audioRecorder.isRecording) {
      // Restart the timer if the recording stopped for some reason
      [self stop];
      [self start:_progressUpdateInterval];
    }
    return;
  }
  (...)

What do you think?

@ncstc1 ncstc1 changed the title Conflict with other AVAudio player/recorder applications iOS: Conflict with other AVAudio player/recorder applications Dec 6, 2022
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

1 participant