Skip to content

Commit e29c8cf

Browse files
committed
chore: resolve conflicts from develop
2 parents f962540 + 0de896d commit e29c8cf

File tree

15 files changed

+541
-377
lines changed

15 files changed

+541
-377
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[![NPM](https://img.shields.io/npm/v/stream-chat-react-native.svg)](https://www.npmjs.com/package/stream-chat-react-native)
1111
[![Build Status](https://github.com/GetStream/stream-chat-react-native/actions/workflows/release.yml/badge.svg)](https://github.com/GetStream/stream-chat-react-native/actions)
1212
[![Component Reference](https://img.shields.io/badge/docs-component%20reference-blue.svg)](https://getstream.io/chat/docs/sdk/reactnative)
13-
![JS Bundle Size](https://img.shields.io/badge/js_bundle_size-456%20KB-blue)
13+
![JS Bundle Size](https://img.shields.io/badge/js_bundle_size-460%20KB-blue)
1414

1515
<img align="right" src="https://getstream.imgix.net/images/ios-chat-tutorial/[email protected]?auto=format,enhance" width="50%" />
1616

examples/ExpoMessaging/yarn.lock

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7026,24 +7026,6 @@ [email protected], stream-buffers@~2.2.0:
70267026
version "0.0.0"
70277027
uid ""
70287028

7029-
7030-
version "6.0.0"
7031-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.0.0.tgz#77798c7082877572ef70223e1f799d22f0c78fe7"
7032-
integrity sha512-3cFao8iL2MjP7nhVRAl1vi526FbPlqUj4BHnYQ7sUNe+xb4z/HCEL6fKFh8kIfK5MEAacOQO4juPPQktoIf7zg==
7033-
dependencies:
7034-
"@gorhom/bottom-sheet" "^5.0.6"
7035-
dayjs "1.10.5"
7036-
emoji-regex "^10.3.0"
7037-
i18next "^21.6.14"
7038-
intl-pluralrules "^2.0.1"
7039-
linkifyjs "^4.1.1"
7040-
lodash-es "4.17.21"
7041-
mime-types "^2.1.34"
7042-
path "0.12.7"
7043-
react-native-markdown-package "1.8.2"
7044-
react-native-url-polyfill "^1.3.0"
7045-
stream-chat "8.46.0"
7046-
70477029
"stream-chat-react-native-core@link:../../package":
70487030
version "0.0.0"
70497031
uid ""

package/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change Log
22

3+
### [6.0.2](https://github.com/GetStream/stream-chat-react-native/compare/v6.0.1...v6.0.2) (2024-12-23)
4+
5+
6+
### Bug Fixes
7+
8+
* audio recording default output ([#2858](https://github.com/GetStream/stream-chat-react-native/issues/2858)) ([d43a7b1](https://github.com/GetStream/stream-chat-react-native/commit/d43a7b1785bc434fc99be2df0cd9c97a52f28e73))
9+
310
### [6.0.1](https://github.com/GetStream/stream-chat-react-native/compare/v6.0.0...v6.0.1) (2024-12-19)
411

512

package/expo-package/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "stream-chat-expo",
33
"description": "The official Expo SDK for Stream Chat, a service for building chat applications",
4-
"version": "6.0.1",
4+
"version": "6.0.2",
55
"author": {
66
"company": "Stream.io Inc",
77
"name": "Stream.io Inc"
@@ -10,7 +10,7 @@
1010
"main": "src/index.js",
1111
"types": "types/index.d.ts",
1212
"dependencies": {
13-
"stream-chat-react-native-core": "6.0.1"
13+
"stream-chat-react-native-core": "6.0.2"
1414
},
1515
"peerDependencies": {
1616
"expo": ">=51.0.0",

package/expo-package/src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
getPhotos,
1212
iOS14RefreshGallerySelection,
1313
oniOS14GalleryLibrarySelectionChange,
14+
overrideAudioRecordingConfiguration,
1415
pickDocument,
1516
pickImage,
1617
saveFile,
@@ -31,6 +32,7 @@ registerNativeHandlers({
3132
getPhotos,
3233
iOS14RefreshGallerySelection,
3334
oniOS14GalleryLibrarySelectionChange,
35+
overrideAudioRecordingConfiguration,
3436
pickDocument,
3537
pickImage,
3638
saveFile,
Lines changed: 38 additions & 232 deletions
Original file line numberDiff line numberDiff line change
@@ -1,216 +1,13 @@
1-
import { AudioComponent, RecordingObject } from './AudioVideo';
2-
3-
export enum AndroidOutputFormat {
4-
DEFAULT = 0,
5-
THREE_GPP = 1,
6-
MPEG_4 = 2,
7-
AMR_NB = 3,
8-
AMR_WB = 4,
9-
AAC_ADIF = 5,
10-
AAC_ADTS = 6,
11-
RTP_AVP = 7,
12-
MPEG2TS = 8,
13-
WEBM = 9,
14-
}
15-
16-
// @docsMissing
17-
export enum AndroidAudioEncoder {
18-
DEFAULT = 0,
19-
AMR_NB = 1,
20-
AMR_WB = 2,
21-
AAC = 3,
22-
HE_AAC = 4,
23-
AAC_ELD = 5,
24-
}
25-
26-
export enum IOSOutputFormat {
27-
LINEARPCM = 'lpcm',
28-
AC3 = 'ac-3',
29-
'60958AC3' = 'cac3',
30-
APPLEIMA4 = 'ima4',
31-
MPEG4AAC = 'aac ',
32-
MPEG4CELP = 'celp',
33-
MPEG4HVXC = 'hvxc',
34-
MPEG4TWINVQ = 'twvq',
35-
MACE3 = 'MAC3',
36-
MACE6 = 'MAC6',
37-
ULAW = 'ulaw',
38-
ALAW = 'alaw',
39-
QDESIGN = 'QDMC',
40-
QDESIGN2 = 'QDM2',
41-
QUALCOMM = 'Qclp',
42-
MPEGLAYER1 = '.mp1',
43-
MPEGLAYER2 = '.mp2',
44-
MPEGLAYER3 = '.mp3',
45-
APPLELOSSLESS = 'alac',
46-
MPEG4AAC_HE = 'aach',
47-
MPEG4AAC_LD = 'aacl',
48-
MPEG4AAC_ELD = 'aace',
49-
MPEG4AAC_ELD_SBR = 'aacf',
50-
MPEG4AAC_ELD_V2 = 'aacg',
51-
MPEG4AAC_HE_V2 = 'aacp',
52-
MPEG4AAC_SPATIAL = 'aacs',
53-
AMR = 'samr',
54-
AMR_WB = 'sawb',
55-
AUDIBLE = 'AUDB',
56-
ILBC = 'ilbc',
57-
DVIINTELIMA = 0x6d730011,
58-
MICROSOFTGSM = 0x6d730031,
59-
AES3 = 'aes3',
60-
ENHANCEDAC3 = 'ec-3',
61-
}
62-
63-
export enum IOSAudioQuality {
64-
MIN = 0,
65-
LOW = 0x20,
66-
MEDIUM = 0x40,
67-
HIGH = 0x60,
68-
MAX = 0x7f,
69-
}
1+
import {
2+
AndroidAudioEncoder,
3+
AndroidOutputFormat,
4+
ExpoAudioRecordingConfiguration as AudioRecordingConfiguration,
5+
IOSAudioQuality,
6+
IOSOutputFormat,
7+
ExpoRecordingOptions as RecordingOptions,
8+
} from 'stream-chat-react-native-core';
709

71-
export type RecordingOptionsAndroid = {
72-
/**
73-
* The desired audio encoder. See the [`AndroidAudioEncoder`](#androidaudioencoder) enum for all valid values.
74-
*/
75-
audioEncoder: AndroidAudioEncoder | number;
76-
/**
77-
* The desired file extension. Example valid values are `.3gp` and `.m4a`.
78-
* For more information, see the [Android docs](https://developer.android.com/guide/topics/media/media-formats)
79-
* for supported output formats.
80-
*/
81-
extension: string;
82-
/**
83-
* The desired file format. See the [`AndroidOutputFormat`](#androidoutputformat) enum for all valid values.
84-
*/
85-
outputFormat: AndroidOutputFormat | number;
86-
/**
87-
* The desired bit rate.
88-
*
89-
* Note that `prepareToRecordAsync()` may perform additional checks on the parameter to make sure whether the specified
90-
* bit rate is applicable, and sometimes the passed bitRate will be clipped internally to ensure the audio recording
91-
* can proceed smoothly based on the capabilities of the platform.
92-
*
93-
* @example `128000`
94-
*/
95-
bitRate?: number;
96-
/**
97-
* The desired maximum file size in bytes, after which the recording will stop (but `stopAndUnloadAsync()` must still
98-
* be called after this point).
99-
*
100-
* @example `65536`
101-
*/
102-
maxFileSize?: number;
103-
/**
104-
* The desired number of channels.
105-
*
106-
* Note that `prepareToRecordAsync()` may perform additional checks on the parameter to make sure whether the specified
107-
* number of audio channels are applicable.
108-
*
109-
* @example `1`, `2`
110-
*/
111-
numberOfChannels?: number;
112-
/**
113-
* The desired sample rate.
114-
*
115-
* Note that the sampling rate depends on the format for the audio recording, as well as the capabilities of the platform.
116-
* For instance, the sampling rate supported by AAC audio coding standard ranges from 8 to 96 kHz,
117-
* the sampling rate supported by AMRNB is 8kHz, and the sampling rate supported by AMRWB is 16kHz.
118-
* Please consult with the related audio coding standard for the supported audio sampling rate.
119-
*
120-
* @example 44100
121-
*/
122-
sampleRate?: number;
123-
};
124-
125-
export type RecordingOptionsIOS = {
126-
/**
127-
* The desired audio quality. See the [`IOSAudioQuality`](#iosaudioquality) enum for all valid values.
128-
*/
129-
audioQuality: IOSAudioQuality | number;
130-
/**
131-
* The desired bit rate.
132-
*
133-
* @example `128000`
134-
*/
135-
bitRate: number;
136-
/**
137-
* The desired file extension.
138-
*
139-
* @example `'.caf'`
140-
*/
141-
extension: string;
142-
/**
143-
* The desired number of channels.
144-
*
145-
* @example `1`, `2`
146-
*/
147-
numberOfChannels: number;
148-
/**
149-
* The desired sample rate.
150-
*
151-
* @example `44100`
152-
*/
153-
sampleRate: number;
154-
/**
155-
* The desired bit depth hint.
156-
*
157-
* @example `16`
158-
*/
159-
bitDepthHint?: number;
160-
/**
161-
* The desired bit rate strategy. See the next section for an enumeration of all valid values of `bitRateStrategy`.
162-
*/
163-
bitRateStrategy?: number;
164-
/**
165-
* The desired PCM bit depth.
166-
*
167-
* @example `16`
168-
*/
169-
linearPCMBitDepth?: number;
170-
/**
171-
* A boolean describing if the PCM data should be formatted in big endian.
172-
*/
173-
linearPCMIsBigEndian?: boolean;
174-
/**
175-
* A boolean describing if the PCM data should be encoded in floating point or integral values.
176-
*/
177-
linearPCMIsFloat?: boolean;
178-
/**
179-
* The desired file format. See the [`IOSOutputFormat`](#iosoutputformat) enum for all valid values.
180-
*/
181-
outputFormat?: string | IOSOutputFormat | number;
182-
};
183-
184-
// @docsMissing
185-
export type RecordingOptionsWeb = {
186-
bitsPerSecond?: number;
187-
mimeType?: string;
188-
};
189-
190-
export type RecordingOptions = {
191-
/**
192-
* Recording options for the Android platform.
193-
*/
194-
android: RecordingOptionsAndroid;
195-
/**
196-
* Recording options for the iOS platform.
197-
*/
198-
ios: RecordingOptionsIOS;
199-
/**
200-
* Recording options for the Web platform.
201-
*/
202-
web: RecordingOptionsWeb;
203-
/**
204-
* A boolean that determines whether audio level information will be part of the status object under the "metering" key.
205-
*/
206-
isMeteringEnabled?: boolean;
207-
/**
208-
* A boolean that hints to keep the audio active after `prepareToRecordAsync` completes.
209-
* Setting this value can improve the speed at which the recording starts. Only set this value to `true` when you call `startAsync`
210-
* immediately after `prepareToRecordAsync`. This value is automatically set when using `Audio.recording.createAsync()`.
211-
*/
212-
keepAudioActiveHint?: boolean;
213-
};
10+
import { AudioComponent, RecordingObject } from './AudioVideo';
21411

21512
const sleep = (ms: number) =>
21613
new Promise<void>((resolve) => {
@@ -221,6 +18,29 @@ const sleep = (ms: number) =>
22118

22219
class _Audio {
22320
recording: typeof RecordingObject | null = null;
21+
audioRecordingConfiguration: AudioRecordingConfiguration = {
22+
mode: {
23+
allowsRecordingIOS: true,
24+
playsInSilentModeIOS: true,
25+
},
26+
options: {
27+
android: {
28+
audioEncoder: AndroidAudioEncoder.AAC,
29+
extension: '.aac',
30+
outputFormat: AndroidOutputFormat.AAC_ADTS,
31+
},
32+
ios: {
33+
audioQuality: IOSAudioQuality.HIGH,
34+
bitRate: 128000,
35+
extension: '.aac',
36+
numberOfChannels: 2,
37+
outputFormat: IOSOutputFormat.MPEG4AAC,
38+
sampleRate: 44100,
39+
},
40+
isMeteringEnabled: true,
41+
web: {},
42+
},
43+
};
22444

22545
startRecording = async (recordingOptions: RecordingOptions, onRecordingStatusUpdate) => {
22646
try {
@@ -242,28 +62,10 @@ class _Audio {
24262
if (!permissionsGranted) {
24363
throw new Error('Missing audio recording permission.');
24464
}
245-
await AudioComponent.setAudioModeAsync({
246-
allowsRecordingIOS: true,
247-
playsInSilentModeIOS: true,
248-
});
249-
const androidOptions = {
250-
audioEncoder: AndroidAudioEncoder.AAC,
251-
extension: '.aac',
252-
outputFormat: AndroidOutputFormat.AAC_ADTS,
253-
};
254-
const iosOptions = {
255-
audioQuality: IOSAudioQuality.HIGH,
256-
bitRate: 128000,
257-
extension: '.aac',
258-
numberOfChannels: 2,
259-
outputFormat: IOSOutputFormat.MPEG4AAC,
260-
sampleRate: 44100,
261-
};
65+
await AudioComponent.setAudioModeAsync(this.audioRecordingConfiguration.mode);
26266
const options = {
26367
...recordingOptions,
264-
android: androidOptions,
265-
ios: iosOptions,
266-
web: {},
68+
...this.audioRecordingConfiguration.options,
26769
};
26870

26971
// This is a band-aid fix for this (still unresolved) issue on Expo's side:
@@ -303,4 +105,8 @@ class _Audio {
303105
};
304106
}
305107

108+
export const overrideAudioRecordingConfiguration = (
109+
audioRecordingConfiguration: AudioRecordingConfiguration,
110+
) => audioRecordingConfiguration;
111+
306112
export const Audio = AudioComponent ? new _Audio() : null;

package/expo-package/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5113,10 +5113,10 @@ [email protected], stream-buffers@~2.2.0:
51135113
resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4"
51145114
integrity sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==
51155115

5116-
5117-
version "6.0.0"
5118-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.0.0.tgz#77798c7082877572ef70223e1f799d22f0c78fe7"
5119-
integrity sha512-3cFao8iL2MjP7nhVRAl1vi526FbPlqUj4BHnYQ7sUNe+xb4z/HCEL6fKFh8kIfK5MEAacOQO4juPPQktoIf7zg==
5116+
5117+
version "6.0.1"
5118+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.0.1.tgz#a67f14685519cafa58466d28eee8f1edc9dbafcf"
5119+
integrity sha512-kyHgGn2PF+JTt7eEKdHMot9Nxzx+yecnlut9oyhi/IJbxOwpjIgB87+rdQXEI5o8SeNwQuAeV3VatxGaxl5Jbw==
51205120
dependencies:
51215121
"@gorhom/bottom-sheet" "^5.0.6"
51225122
dayjs "1.10.5"

0 commit comments

Comments
 (0)