Skip to content

Commit

Permalink
[Docs]NoiseCancellation docs to mention performance needs (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
ipavlidakis authored May 1, 2024
1 parent 015a3b9 commit 7f09097
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
12 changes: 11 additions & 1 deletion docusaurus/docs/iOS/03-guides/04-noise-cancellation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,24 @@ 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.

- `.autoOn`
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
Expand Down
6 changes: 5 additions & 1 deletion docusaurus/docs/iOS/05-ui-cookbook/19-noise-cancellation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7f09097

Please sign in to comment.