Skip to content

Commit

Permalink
Update sound related docs
Browse files Browse the repository at this point in the history
  • Loading branch information
liviu-timar committed Sep 16, 2024
1 parent 927ea98 commit 5d8ef1e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
The SDK plays sounds for incoming and outgoing calls. Read [here](../06-advanced/01-ringing.mdx#sounds) for more details.
10 changes: 10 additions & 0 deletions docusaurus/docs/Android/06-advanced/01-ringing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit 5d8ef1e

Please sign in to comment.