From 7f0909790ef3647d65c835d5f94723195494df80 Mon Sep 17 00:00:00 2001 From: Ilias Pavlidakis Date: Wed, 1 May 2024 17:03:21 +0300 Subject: [PATCH] [Docs]NoiseCancellation docs to mention performance needs (#378) --- .../docs/iOS/03-guides/04-noise-cancellation.mdx | 12 +++++++++++- .../iOS/05-ui-cookbook/19-noise-cancellation.mdx | 6 +++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/docusaurus/docs/iOS/03-guides/04-noise-cancellation.mdx b/docusaurus/docs/iOS/03-guides/04-noise-cancellation.mdx index 221d56746..09c21579f 100644 --- a/docusaurus/docs/iOS/03-guides/04-noise-cancellation.mdx +++ b/docusaurus/docs/iOS/03-guides/04-noise-cancellation.mdx @@ -48,6 +48,14 @@ Once you are able to create a `NoiseCancellationFilter` you can rely on `Call`'s - `.available` The featue has been enabled on the dashboard and it's available for the call. In this case, you are free to present any noise cancellation toggle UI in your application. +:::important +Even though the feature may be enabled for your call, you should note that NoiseCancellation is a very performance-heavy process. For that reason, it's recommended to only allow the feature on devices that support Apple's neuralEngine. + +You can easily check if the current device has neuralEngine support by using `StreamVideo.isHardwareAccelerationAvailable` on your streamVideo initialized instance. + +For more info you can refer to our [UI docs](../../ui-cookbook/noise-cancellation). about Noise Cancellation. +::: + - `.disabled` The feature hasn't been enabled on the dashboard or the feature isn't available for the call. In this case, you should hide any noise cancellation toggle UI in your application. @@ -55,7 +63,9 @@ The feature hasn't been enabled on the dashboard or the feature isn't available Similar to `.available` with the difference that if possible, the StreamVideo SDK will enable the filter automatically, when the user join the call. :::note -You will need to ensure that you have provided a `VideoConfig.noiseCancellationFilter` value when you initialise StreamVideo, in order for the `.autoOn` mode to work properly. +The requirements for `.autoOn` to work properly are: +- A `VideoConfig.noiseCancellationFilter` value when you initialise StreamVideo +- Device has support for Apple's neuralEngine ::: #### Activate/Deactivate the filter diff --git a/docusaurus/docs/iOS/05-ui-cookbook/19-noise-cancellation.mdx b/docusaurus/docs/iOS/05-ui-cookbook/19-noise-cancellation.mdx index 32dc58962..062bb6fa4 100644 --- a/docusaurus/docs/iOS/05-ui-cookbook/19-noise-cancellation.mdx +++ b/docusaurus/docs/iOS/05-ui-cookbook/19-noise-cancellation.mdx @@ -31,7 +31,11 @@ struct NoiseCancellationButtonView: View { } var body: some View { - if let call = viewModel.call, let noiseCancellationAudioFilter = streamVideo.videoConfig.noiseCancellationFilter { + if + let call = viewModel.call, // Ensure we have an active call. + let noiseCancellationAudioFilter = streamVideo.videoConfig.noiseCancellationFilter, // Ensure that we have noiseCancellation audioFilter to activate. + streamVideo.isHardwareAccelerationAvailable // Ensure that the device supports Apple's neuralEngine. + { Group { if isNoiseCancellationAvailable { Button {