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

Is it possible to set preferredIOBufferDuration for AVAudioSession #104

Open
ctwdtw opened this issue Aug 16, 2023 · 3 comments
Open

Is it possible to set preferredIOBufferDuration for AVAudioSession #104

ctwdtw opened this issue Aug 16, 2023 · 3 comments

Comments

@ctwdtw
Copy link

ctwdtw commented Aug 16, 2023

In native iOS we can set preferredIOBufferDuration:

let audioSession = AVAudioSession.sharedInstance()
let preferredIOBufferDuration: TimeInterval = 1.0 / audioSession.sampleRate * Double(self.BUFFER_SIZE)
try audioSession.setPreferredIOBufferDuration(Double(preferredIOBufferDuration))

Do we have an interface in the AudioSession class for doing that?

@AlexBacich
Copy link

Same for setPrefersNoInterruptionsFromSystemAlerts

@ryanheise
Copy link
Owner

Not yet. You can see in lib/src/darwin.dart that this is currently commented out as a TODO item for perhaps a contributor to pick up:

  //Future<Duration> get preferredIoBufferDuration async {
  //  return Duration.zero;
  //}

  //Future<void> setPreferredIoBufferDuration(Duration duration) async {}

You are welcome to try your hand at implementing the additional methods you need and submit it as a PR.

@AlexBacich
Copy link

Created PR for setPrefersNoInterruptionsFromSystemAlerts and get*

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

3 participants