Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #191 from DolbyIO/release/3.10.0-beta.1
Browse files Browse the repository at this point in the history
Release/3.10.0 beta.1
  • Loading branch information
graduad authored Jul 3, 2023
2 parents 5d3fbee + 0a9c4a2 commit 9633b15
Show file tree
Hide file tree
Showing 62 changed files with 988 additions and 144 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ dependencies {
implementation "androidx.appcompat:appcompat:1.1.0"
implementation "androidx.annotation:annotation:1.1.0"

implementation "io.dolby:sdk:3.8.+"
implementation "io.dolby:sdk:3.10.+"

testImplementation("junit:junit:${JUNIT_VERSION}")
testImplementation("org.powermock:powermock-api-mockito2:${POWERMOCK_VERSION}")
Expand Down
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ MOCKITO_CORE_VERSION=2.26.0
POWERMOCK_VERSION=2.0.2
ROBOLECTRIC_VERSION=4.4
JUNIT_VERSION=4.13.2
COMMS_SDK_VERSION="3.8.1"
COMMS_SDK_VERSION="3.10.0-beta.1"
COMPONENT_NAME="react-native-sdk"
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.voxeet.android.media.capture.audio.Mode
import com.voxeet.android.media.capture.audio.noise.NoiseReduction
import com.voxeet.android.media.capture.audio.noise.StandardNoiseReduction
import com.voxeet.android.media.utils.ComfortNoiseLevel
import com.voxeet.android.media.capture.audio.VoiceFont

/**
* Provides methods that map media-related models to React Native models and vice versa
Expand All @@ -30,13 +31,15 @@ class AudioMapper {

fun audioCaptureFromRN(audioCaptureRN: ReadableMap): AudioCaptureMode =
when (modeFromRN(audioCaptureRN.getString(MODE))) {
Mode.STANDARD -> AudioCaptureMode.standard(noiseReductionFromRN(audioCaptureRN.getString(NOISE_REDUCTION)))
Mode.STANDARD -> AudioCaptureMode.standard(
noiseReductionFromRN(audioCaptureRN.getString(NOISE_REDUCTION)), voiceFontFromRN(audioCaptureRN.getString(VOICE_FONT)))
Mode.UNPROCESSED -> AudioCaptureMode.unprocessed()
}

fun audioCaptureToRN(audioCaptureMode: AudioCaptureMode) = Arguments.createMap().apply {
putString(MODE, audioCaptureMode.mode.toRN())
audioCaptureMode.noiseReduction?.let { putString(NOISE_REDUCTION, it.toRN()) }
audioCaptureMode.voiceFont?.let { putString(VOICE_FONT, it.toRN()) }
}

private fun Mode.toRN(): String = when (this) {
Expand All @@ -59,8 +62,41 @@ class AudioMapper {
else -> StandardNoiseReduction.LOW
}

private fun VoiceFont.toRN(): String = when (this) {
VoiceFont.MASCULINE -> "MASCULINE"
VoiceFont.FEMININE -> "FEMININE"
VoiceFont.HELIUM -> "HELIUM"
VoiceFont.DARK_MODULATION -> "DARK_MODULATION"
VoiceFont.BROKEN_ROBOT -> "BROKEN_ROBOT"
VoiceFont.INTERFERENCE -> "INTERFERENCE"
VoiceFont.ABYSS -> "ABYSS"
VoiceFont.WOBBLE -> "WOBBLE"
VoiceFont.STARSHIP_CAPTAIN -> "STARSHIP_CAPTAIN"
VoiceFont.NERVOUS_ROBOT -> "NERVOUS_ROBOT"
VoiceFont.SWARM -> "SWARM"
VoiceFont.AM_RADIO -> "AM_RADIO"
else -> "NONE"
}

private fun voiceFontFromRN(font: String?): VoiceFont = when (font) {
"MASCULINE" -> VoiceFont.MASCULINE
"FEMININE" -> VoiceFont.FEMININE
"HELIUM" -> VoiceFont.HELIUM
"DARK_MODULATION" -> VoiceFont.DARK_MODULATION
"BROKEN_ROBOT" -> VoiceFont.BROKEN_ROBOT
"INTERFERENCE" -> VoiceFont.INTERFERENCE
"ABYSS" -> VoiceFont.ABYSS
"WOBBLE" -> VoiceFont.WOBBLE
"STARSHIP_CAPTAIN" -> VoiceFont.STARSHIP_CAPTAIN
"NERVOUS_ROBOT" -> VoiceFont.NERVOUS_ROBOT
"SWARM" -> VoiceFont.SWARM
"AM_RADIO" -> VoiceFont.AM_RADIO
else -> VoiceFont.NONE
}

companion object {
private const val MODE = "mode"
private const val NOISE_REDUCTION = "noiseReduction"
private const val VOICE_FONT = "voiceFont"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,20 @@ class RNSessionServiceModule(
.promise(sessionService.isOpen)
.forward(promise)
}

/**
* Updates the local participant's name and avatar URL.
* This method is supported in SDK 3.9 and later.
*
* @param name The preferred participant name.
* @param avatarUrl The preferred avatar URL.
* @param promise returns null
*/
@ReactMethod
fun updateParticipantInfo(name: String, avatarUrl: String, promise: Promise) {
sessionService
.update(name, avatarUrl)
.rejectIfFalse { "Update participant operation failed" }
.forward(promise)
}
}
6 changes: 6 additions & 0 deletions docs/classes/CommsAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ CommsAPI is a main object that allows an application to interact with Dolby.io s

Retrieves the AudioService instance that allows changing audio settings for the local and remote participants.

This API is available in SDK 3.7 and later.

___

### command
Expand Down Expand Up @@ -112,6 +114,8 @@ ___

Retrieves the VideoService instance that allows enabling and disabling video for the local and remote participants.

This API is available in SDK 3.7 and later.

## Methods

### initialize
Expand All @@ -138,7 +142,9 @@ ___
**initializeToken**(`accessToken`, `refreshAccessToken`): `Promise`<``null``\>

Initializes the SDK with the client access token provided by the Dolby.io platform. The client access token protects customer's conferences from unauthorized access and can be generated only by the Dolby.io platform via an application's authentication server and the [client access token](ref:get-client-access-token) request.

The method requires providing two parameters - the **client access token** received from the Dolby.io platform and the **refresh access token** callback. The callback must be a function that requests a new token and returns a promise containing the refreshed client access token when the token is incorrect or needs to be refreshed. The refresh token callback uses an **isExpired** boolean parameter to inform whether the currently used client access token is expired.

For more information, see the [Accessing Dolby.io Platform](doc:guides-accessing-dolbyio-platform) guide.

#### Parameters
Expand Down
2 changes: 1 addition & 1 deletion docs/classes/internal.ConferenceService.md
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ The default spatial environment is presented in the following diagram:

| Name | Type | Description |
| :------ | :------ | :------ |
| `scale` | [`SpatialScale`](../interfaces/internal.SpatialScale.md) | A scale that defines how to convert units from the coordinate system of an application (pixels or centimeters) into meters used by the spatial audio coordinate system. For example, if SpatialScale is set to (100,100,100), it indicates that 100 of the applications units (cm) map to 1 meter for the audio coordinates. In such a case, if the listener's location is (0,0,0)cm and a remote participant's location is (200,200,200)cm, the listener has an impression of hearing the remote participant from the (2,2,2)m location. The scale value must be greater than 0. For more information, see the [Spatial Audio](doc:guides-integrating-individual-spatial-audio#configure-the-spatial-environment-scale) article. |
| `scale` | [`SpatialScale`](../interfaces/internal.SpatialScale.md) | A scale that defines how to convert units from the coordinate system of an application (pixels or centimeters) into meters used by the spatial audio coordinate system. For example, if SpatialScale is set to (100,100,100), it indicates that 100 of the applications units (cm) map to 1 meter for the audio coordinates. In such a case, if the listener's location is (0,0,0)cm and a remote participant's location is (200,200,200)cm, the listener has an impression of hearing the remote participant from the (2,2,2)m location. The scale value must be greater than 0. For more information, see the [Spatial Chat](doc:guides-integrating-individual-spatial-chat#configure-the-spatial-environment-scale) article. |
| `forward` | [`SpatialPosition`](../interfaces/internal.SpatialPosition.md) | A vector describing the direction the application considers as forward. The value can be either +1, 0, or -1 and must be orthogonal to up and right. |
| `up` | [`SpatialPosition`](../interfaces/internal.SpatialPosition.md) | A vector describing the direction the application considers as up. The value can be either +1, 0, or -1 and must be orthogonal to forward and right. |
| `right` | [`SpatialPosition`](../interfaces/internal.SpatialPosition.md) | A vector describing the direction the application considers as right. The value can be either +1, 0, or -1 and must be orthogonal to forward and up. |
Expand Down
8 changes: 7 additions & 1 deletion docs/classes/internal.LocalAudio.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ ___

**setCaptureMode**(`options`): `Promise`<`void`\>

Sets the local participant's audio capture mode in Dolby Voice conferences.
Sets the local participant's audio capture mode. The following modes are available:

- Standard: The default mode that optimizes captured audio for speech by aggressively removing non-speech content, such as background noise. The mode is supported in SDK 3.7 and later.

- Unprocessed: Reduces latency that comes from audio processing and prevents over-processing audio in some scenarios. The mode is supported in SDK 3.7 and later.

Note: In SDK 3.8 and prior releases, this API is supported only in Dolby Voice conferences.

#### Parameters

Expand Down
16 changes: 8 additions & 8 deletions docs/classes/internal.NotificationService.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The NotificationService allows inviting participants to a conference and subscri

**subscribe**(`events`): `Promise`<`void`\>

Subscribes to the specified notifications.
Subscribes to the specified notifications. This method is supported in SDK 3.8 and later.

#### Parameters

Expand All @@ -54,7 +54,7 @@ ___

**unsubscribe**(`events`): `Promise`<`void`\>

Unsubscribes from the specified notifications.
Unsubscribes from the specified notifications. This method is supported in SDK 3.8 and later.

#### Parameters

Expand Down Expand Up @@ -129,7 +129,7 @@ ___

**onConferenceStatus**(`handler`): [`UnsubscribeFunction`](../modules/internal.md#unsubscribefunction)

Adds a listener to the conference status event.
Adds a listener to the conference status event. This API is supported in SDK 3.8 and later.

#### Parameters

Expand All @@ -149,7 +149,7 @@ ___

**onConferenceCreated**(`handler`): [`UnsubscribeFunction`](../modules/internal.md#unsubscribefunction)

Adds a listener to the conference created event.
Adds a listener to the conference created event. This API is supported in SDK 3.8 and later.

#### Parameters

Expand All @@ -169,7 +169,7 @@ ___

**onConferenceEnded**(`handler`): [`UnsubscribeFunction`](../modules/internal.md#unsubscribefunction)

Adds a listener to the conference ended event.
Adds a listener to the conference ended event. This API is supported in SDK 3.8 and later.

#### Parameters

Expand All @@ -189,7 +189,7 @@ ___

**onParticipantJoined**(`handler`): [`UnsubscribeFunction`](../modules/internal.md#unsubscribefunction)

Adds a listener to the participant joined event.
Adds a listener to the participant joined event. This API is supported in SDK 3.8 and later.

#### Parameters

Expand All @@ -209,7 +209,7 @@ ___

**onParticipantLeft**(`handler`): [`UnsubscribeFunction`](../modules/internal.md#unsubscribefunction)

Adds a listener to the participant left event.
Adds a listener to the participant left event. This API is supported in SDK 3.8 and later.

#### Parameters

Expand All @@ -229,7 +229,7 @@ ___

**onActiveParticipants**(`handler`): [`UnsubscribeFunction`](../modules/internal.md#unsubscribefunction)

Adds a listener to the participant active event.
Adds a listener to the participant active event. This API is supported in SDK 3.8 and later.

#### Parameters

Expand Down
20 changes: 20 additions & 0 deletions docs/classes/internal.SessionService.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The SessionService allows opening and closing sessions. Opening a session is man
- [getParticipant](internal.SessionService.md#getparticipant)
- [isOpen](internal.SessionService.md#isopen)
- [open](internal.SessionService.md#open)
- [updateParticipantInfo](internal.SessionService.md#updateparticipantinfo)

## Constructors

Expand Down Expand Up @@ -77,3 +78,22 @@ Opens a new session. If you initialize the SDK with a [client access token](ref:
#### Returns

`Promise`<`void`\>

___

### updateParticipantInfo

**updateParticipantInfo**(`name`, `avatarUrl`): `Promise`<`void`\>

Updates the local participant's name and avatar URL. This method is supported in SDK 3.10 and later.

#### Parameters

| Name | Type |
| :------ | :------ |
| `name` | `String` |
| `avatarUrl` | `String` |

#### Returns

`Promise`<`void`\>
8 changes: 3 additions & 5 deletions docs/enums/internal.AudioCaptureMode.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

[internal](../modules/internal.md).AudioCaptureMode

The AudioCaptureMode model allows enabling and disabling audio processing for the local participant.

By default, the Dolby Voice audio processing algorithm is enabled in Dolby Voice conferences to improve voice communication. However, audio processing lowers the quality of non-voice audio. To send non-voice audio, such as music, disable audio processing by using the Unprocessed mode.
The AudioCaptureMode model allows selecting the preferred mode for capturing the local participant's audio.

This model is available in SDK 3.7 and later.

Expand All @@ -21,12 +19,12 @@ This model is available in SDK 3.7 and later.

**Standard** = ``"STANDARD"``

Enables audio processing to improve voice quality.
The default mode aimed at enhancing speech to create a conversation-focused conference environment. This mode optimizes captured audio for speech by aggressively removing non-speech content, such as background noise. The mode is supported in SDK 3.7 and later.

___

### Unprocessed

**Unprocessed** = ``"UNPROCESSED"``

Disables audio processing to allow transmitting non-voice audio to a conference.
Disables audio processing to allow transmitting non-voice audio to a conference. The mode is supported in SDK 3.7 and later.
4 changes: 2 additions & 2 deletions docs/enums/internal.NoiseReductionLevel.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ This model is available in SDK 3.7 and later.

**High** = ``"HIGH"``

Removes all background sounds to improve voice quality. Use this mode if you want to send only voice to a conference.
The default level that removes all background sounds to improve voice quality. Use this mode if you want to send only voice to a conference.

___

### Low

**Low** = ``"LOW"``

Removes stationary background sounds, such as the sound of a computer fan, air conditioning, or microphone hum, from audio transmitted to a conference. In this mode, non-stationary sounds are transmitted to give participants full context of other participants' environments and create a more realistic audio experience. If you want to send only voice to a conference, use the High level.
Removes stationary background sounds, such as the sound of a computer fan, air conditioning, or microphone hum, from audio transmitted to a conference. In this mode, non-stationary sounds are transmitted to give participants full context of other participants' environments and create a more realistic audio experience. If you want to send only voice to a conference, use the [High](#high) level.
Loading

0 comments on commit 9633b15

Please sign in to comment.