From 1f0b12a476816c1bf873e64882ea7a7c00fa3bf3 Mon Sep 17 00:00:00 2001 From: Liviu Timar <65943217+liviu-timar@users.noreply.github.com> Date: Mon, 16 Sep 2024 15:45:45 +0300 Subject: [PATCH] Update sound related docs --- .../05-ui-cookbook/05-incoming-and-outgoing-call.mdx | 5 +---- docusaurus/docs/Android/06-advanced/01-ringing.mdx | 10 ++++++++++ .../io/getstream/video/android/core/sounds/Sounds.kt | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docusaurus/docs/Android/05-ui-cookbook/05-incoming-and-outgoing-call.mdx b/docusaurus/docs/Android/05-ui-cookbook/05-incoming-and-outgoing-call.mdx index e405a5d0d8..58b13cdb66 100644 --- a/docusaurus/docs/Android/05-ui-cookbook/05-incoming-and-outgoing-call.mdx +++ b/docusaurus/docs/Android/05-ui-cookbook/05-incoming-and-outgoing-call.mdx @@ -87,8 +87,5 @@ fun MyRingingCallScreen() { So you'll be able to render your own composable or navigate to a different screen depending on the call state. ## Sounds -The SDK plays default sounds for incoming and outgoing calls. You can customize the sounds by passing your own instance of the `Sounds` class to `StreamVideoBuilder`. -`Sounds` has two properties, `incomingCallSound` and `outgoingCallSound`. You need to assign raw resource identifiers to these properties. These identifiers correspond to audio files in your project's `res/raw` directory. - -To disable sounds, pass `null` to `incomingCallSound` or `outgoingCallSound`. \ No newline at end of file +The SDK plays sounds for incoming and outgoing calls. Read [here](../06-advanced/01-ringing.mdx#sounds) for more details. \ No newline at end of file diff --git a/docusaurus/docs/Android/06-advanced/01-ringing.mdx b/docusaurus/docs/Android/06-advanced/01-ringing.mdx index 26d86eae60..0f34e9682c 100644 --- a/docusaurus/docs/Android/06-advanced/01-ringing.mdx +++ b/docusaurus/docs/Android/06-advanced/01-ringing.mdx @@ -116,3 +116,13 @@ For this you need to leave the call by using: call.leave() ``` +### Sounds + +The SDK plays sounds for incoming and outgoing calls. You can customize these sounds by passing your own instance of the `Sounds` class to the `StreamVideoBuilder` `sounds` constructor parameter. + +`Sounds` has two resource properties, `incomingCallSoundResId` and `outgoingCallSoundResId`. These properties can have the following values: +- By default, their values are the device ringtone for incoming and a default ringing tone provided by the SDK for outgoing. +- You can pass raw resource identifiers that correspond to audio files in your project's `res/raw` directory. +- To disable (mute) one of the sounds, pass `null` to the corresponding property. +- You can pass the `Sounds.DEVICE_INCOMING_RINGTONE` special value to `incomingCallSoundResId` to use the device ringtone. +- Special cases: if the device ringtone is evaluated to `null` or the outgoing sound is set to `DEVICE_INCOMING_RINGTONE`, a corresponding default sound will be used. \ No newline at end of file diff --git a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/sounds/Sounds.kt b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/sounds/Sounds.kt index 3417750424..9e812e0f72 100644 --- a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/sounds/Sounds.kt +++ b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/sounds/Sounds.kt @@ -26,6 +26,7 @@ import io.getstream.video.android.core.R /** * Contains all the sounds that the SDK uses. * + * @param context Context to be used for retrieving the sounds. * @param incomingCallSoundResId Resource to be used as a ringtone for incoming calls. Set to [DEVICE_INCOMING_RINGTONE] to use the device ringtone. * @param outgoingCallSoundResId Resource to be used as a ringing tone for outgoing calls. */