Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Audio Preview screen #206

Merged
merged 2 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
159 changes: 159 additions & 0 deletions docs/classes/internal.AudioPreview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
# Class: AudioPreview

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

The AudioPreview allows to test audio settings (voice font, noise reduction, capture mode) before join to conference.

This feature is available in SDK 3.10 and later.

## Table of contents

### Constructors

- [constructor](internal.AudioPreview.md#constructor)

### Methods

- [status](internal.AudioPreview.md#status)
- [getCaptureMode](internal.AudioPreview.md#getcapturemode)
- [setCaptureMode](internal.AudioPreview.md#setcapturemode)
- [play](internal.AudioPreview.md#play)
- [record](internal.AudioPreview.md#record)
- [cancel](internal.AudioPreview.md#cancel)
- [release](internal.AudioPreview.md#release)
- [onStatusChanged](internal.AudioPreview.md#onstatuschanged)

## Constructors

### constructor

• **new AudioPreview**()

## Methods

### status

▸ **status**(): `Promise`<[`RecorderStatus`](../enums/internal.RecorderStatus.md)\>

Gets the recording status.

#### Returns

`Promise`<[`RecorderStatus`](../enums/internal.RecorderStatus.md)\>

RecorderStatus

___

### getCaptureMode

▸ **getCaptureMode**(): `Promise`<[`AudioCaptureModeOptions`](../interfaces/internal.AudioCaptureModeOptions.md)\>

Gets an audio capture mode for the audio preview.

#### Returns

`Promise`<[`AudioCaptureModeOptions`](../interfaces/internal.AudioCaptureModeOptions.md)\>

AudioCaptureModeOptions

___

### setCaptureMode

▸ **setCaptureMode**(`captureMode`): `Promise`<`void`\>

Sets an audio capture mode for the audio preview.

#### Parameters

| Name | Type |
| :------ | :------ |
| `captureMode` | [`AudioCaptureModeOptions`](../interfaces/internal.AudioCaptureModeOptions.md) |

#### Returns

`Promise`<`void`\>

void

___

### play

▸ **play**(`loop`): `Promise`<`void`\>

Plays back the recorded audio sample. To test how your audio sounds while using different capture modes and voice fonts, set the captureMode to a preferred setting before using the method.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `loop` | `boolean` | A boolean that indicates wether the SDK should play the recorded audio in a loop. |

#### Returns

`Promise`<`void`\>

___

### record

▸ **record**(`duration`): `Promise`<`void`\>

Plays back the recorded audio sample. To test how your audio sounds while using different capture modes and voice fonts,
set the captureMode to a preferred setting before using the method.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `duration` | `number` | The preferred recording duration, in seconds. |

#### Returns

`Promise`<`void`\>

___

### cancel

▸ **cancel**(): `Promise`<`boolean`\>

Cancels recording or playing an audio sample.

#### Returns

`Promise`<`boolean`\>

true for success, false when failed

___

### release

▸ **release**(): `Promise`<`void`\>

Release the internal memory and restart the audio session configuration.

#### Returns

`Promise`<`void`\>

void

___

### onStatusChanged

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

#### Parameters

| Name | Type |
| :------ | :------ |
| `handler` | (`data`: [`AudioPreviewStatusChangedEventType`](../interfaces/internal.AudioPreviewStatusChangedEventType.md)) => `void` |

#### Returns

[`UnsubscribeFunction`](../modules/internal.md#unsubscribefunction)
11 changes: 11 additions & 0 deletions docs/classes/internal.LocalAudio.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This model is supported only in SDK 3.7 and later.
- [setComfortNoiseLevel](internal.LocalAudio.md#setcomfortnoiselevel)
- [start](internal.LocalAudio.md#start)
- [stop](internal.LocalAudio.md#stop)
- [preview](internal.LocalAudio.md#preview)

## Constructors

Expand Down Expand Up @@ -122,3 +123,13 @@ The method requires up to a few seconds to become effective.
#### Returns

`Promise`<`void`\>

___

### preview

▸ **preview**(): [`AudioPreview`](internal.AudioPreview.md)

#### Returns

[`AudioPreview`](internal.AudioPreview.md)
57 changes: 57 additions & 0 deletions docs/enums/internal.RecorderStatus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Enumeration: RecorderStatus

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

The RecorderStatus model gathers all possible statuses of audio samples recording for audio preview.

This model is available in SDK 3.10 and later.

## Table of contents

### Enumeration Members

- [NoRecordingAvailable](internal.RecorderStatus.md#norecordingavailable)
- [RecordingAvailable](internal.RecorderStatus.md#recordingavailable)
- [Recording](internal.RecorderStatus.md#recording)
- [Playing](internal.RecorderStatus.md#playing)
- [Released](internal.RecorderStatus.md#released)

## Enumeration Members

### NoRecordingAvailable

• **NoRecordingAvailable** = ``0``

There is no recording available.

___

### RecordingAvailable

• **RecordingAvailable** = ``1``

The recording is available.

___

### Recording

• **Recording** = ``2``

Recording is in progress.

___

### Playing

• **Playing** = ``3``

The recording is played.

___

### Released

• **Released** = ``4``

The audio session configuration is restarted; there are no recording in the memory.
18 changes: 18 additions & 0 deletions docs/interfaces/internal.AudioPreviewStatusChangedEventType.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Interface: AudioPreviewStatusChangedEventType

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

The AudioPreviewStatusChangedEventType model gathers information about changes of audio preview status.
The model is supported in SDK 3.10 and later.

## Table of contents

### Properties

- [status](internal.AudioPreviewStatusChangedEventType.md#status)

## Properties

### status

• **status**: [`RecorderStatus`](../enums/internal.RecorderStatus.md)
39 changes: 21 additions & 18 deletions docs/modules/internal.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Classes

- [AudioPreview](../classes/internal.AudioPreview.md)
- [AudioService](../classes/internal.AudioService.md)
- [LocalAudio](../classes/internal.LocalAudio.md)
- [RemoteAudio](../classes/internal.RemoteAudio.md)
Expand All @@ -19,26 +20,9 @@
- [VideoService](../classes/internal.VideoService.md)
- [VideoPresentationService](../classes/internal.VideoPresentationService.md)

### Enumerations

- [ComfortNoiseLevel](../enums/internal.ComfortNoiseLevel.md)
- [AudioCaptureMode](../enums/internal.AudioCaptureMode.md)
- [NoiseReductionLevel](../enums/internal.NoiseReductionLevel.md)
- [VoiceFont](../enums/internal.VoiceFont.md)
- [ConferenceStatus](../enums/internal.ConferenceStatus.md)
- [ParticipantStatus](../enums/internal.ParticipantStatus.md)
- [ParticipantType](../enums/internal.ParticipantType.md)
- [RTCPMode](../enums/internal.RTCPMode.md)
- [Codec](../enums/internal.Codec.md)
- [ConferencePermission](../enums/internal.ConferencePermission.md)
- [MediaStreamType](../enums/internal.MediaStreamType.md)
- [SpatialAudioStyle](../enums/internal.SpatialAudioStyle.md)
- [VideoForwardingStrategy](../enums/internal.VideoForwardingStrategy.md)
- [RecordingStatus](../enums/internal.RecordingStatus.md)
- [VideoPresentationState](../enums/internal.VideoPresentationState.md)

### Interfaces

- [AudioPreviewStatusChangedEventType](../interfaces/internal.AudioPreviewStatusChangedEventType.md)
- [AudioCaptureModeOptions](../interfaces/internal.AudioCaptureModeOptions.md)
- [MessageReceivedEventType](../interfaces/internal.MessageReceivedEventType.md)
- [ParticipantChangedEventType](../interfaces/internal.ParticipantChangedEventType.md)
Expand Down Expand Up @@ -82,6 +66,25 @@
- [VideoPresentationEventType](../interfaces/internal.VideoPresentationEventType.md)
- [VideoPresentation](../interfaces/internal.VideoPresentation.md)

### Enumerations

- [ComfortNoiseLevel](../enums/internal.ComfortNoiseLevel.md)
- [AudioCaptureMode](../enums/internal.AudioCaptureMode.md)
- [NoiseReductionLevel](../enums/internal.NoiseReductionLevel.md)
- [VoiceFont](../enums/internal.VoiceFont.md)
- [RecorderStatus](../enums/internal.RecorderStatus.md)
- [ConferenceStatus](../enums/internal.ConferenceStatus.md)
- [ParticipantStatus](../enums/internal.ParticipantStatus.md)
- [ParticipantType](../enums/internal.ParticipantType.md)
- [RTCPMode](../enums/internal.RTCPMode.md)
- [Codec](../enums/internal.Codec.md)
- [ConferencePermission](../enums/internal.ConferencePermission.md)
- [MediaStreamType](../enums/internal.MediaStreamType.md)
- [SpatialAudioStyle](../enums/internal.SpatialAudioStyle.md)
- [VideoForwardingStrategy](../enums/internal.VideoForwardingStrategy.md)
- [RecordingStatus](../enums/internal.RecordingStatus.md)
- [VideoPresentationState](../enums/internal.VideoPresentationState.md)

### Enumeration Members

- [ParticipantAdded](internal.md#participantadded)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { StyleSheet } from 'react-native';
import COLORS from '@constants/colors.constants';
import { SPACE_XXS } from '@constants/sizes.constants';
import { SPACE_XXS, SPACE_L } from '@constants/sizes.constants';

export default StyleSheet.create({
wrapper: {
Expand All @@ -11,4 +11,20 @@ export default StyleSheet.create({
padding: 10,
borderRadius: SPACE_XXS,
},
actionButtons: {
flexDirection: 'row',
flexWrap: 'wrap',

},
menuBackdrop: {
backgroundColor: 'rgba(0,0,0,0.5)',
opacity: 1,
},
menuButton: {
justifyContent: 'center',
flexDirection: 'row',
flexWrap: 'wrap',
backgroundColor: COLORS.BLUE,
borderRadius: SPACE_L,
},
});