Skip to content

Commit 30999db

Browse files
committed
Fixes
1 parent 8201f25 commit 30999db

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

ios/RCTWebRTC/WebRTCModule+RTCAudioDeviceModule.m

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ @implementation WebRTCModule (RTCAudioDeviceModule)
1515
: (RCTPromiseRejectBlock)reject) {
1616
NSInteger result = [self.audioDeviceModule startPlayout];
1717
if (result == 0) {
18-
resolve(@{@"success" : @YES});
18+
resolve(nil);
1919
} else {
2020
reject(@"playout_error", [NSString stringWithFormat:@"Failed to start playout: %ld", (long)result], nil);
2121
}
@@ -26,7 +26,7 @@ @implementation WebRTCModule (RTCAudioDeviceModule)
2626
: (RCTPromiseRejectBlock)reject) {
2727
NSInteger result = [self.audioDeviceModule stopPlayout];
2828
if (result == 0) {
29-
resolve(@{@"success" : @YES});
29+
resolve(nil);
3030
} else {
3131
reject(@"playout_error", [NSString stringWithFormat:@"Failed to stop playout: %ld", (long)result], nil);
3232
}
@@ -37,7 +37,7 @@ @implementation WebRTCModule (RTCAudioDeviceModule)
3737
: (RCTPromiseRejectBlock)reject) {
3838
NSInteger result = [self.audioDeviceModule startRecording];
3939
if (result == 0) {
40-
resolve(@{@"success" : @YES});
40+
resolve(nil);
4141
} else {
4242
reject(@"recording_error", [NSString stringWithFormat:@"Failed to start recording: %ld", (long)result], nil);
4343
}
@@ -48,7 +48,7 @@ @implementation WebRTCModule (RTCAudioDeviceModule)
4848
: (RCTPromiseRejectBlock)reject) {
4949
NSInteger result = [self.audioDeviceModule stopRecording];
5050
if (result == 0) {
51-
resolve(@{@"success" : @YES});
51+
resolve(nil);
5252
} else {
5353
reject(@"recording_error", [NSString stringWithFormat:@"Failed to stop recording: %ld", (long)result], nil);
5454
}
@@ -59,7 +59,7 @@ @implementation WebRTCModule (RTCAudioDeviceModule)
5959
: (RCTPromiseRejectBlock)reject) {
6060
NSInteger result = [self.audioDeviceModule initAndStartRecording];
6161
if (result == 0) {
62-
resolve(@{@"success" : @YES});
62+
resolve(nil);
6363
} else {
6464
reject(
6565
@"recording_error", [NSString stringWithFormat:@"Failed to start local recording: %ld", (long)result], nil);
@@ -71,7 +71,7 @@ @implementation WebRTCModule (RTCAudioDeviceModule)
7171
: (RCTPromiseRejectBlock)reject) {
7272
NSInteger result = [self.audioDeviceModule stopRecording];
7373
if (result == 0) {
74-
resolve(@{@"success" : @YES});
74+
resolve(nil);
7575
} else {
7676
reject(
7777
@"recording_error", [NSString stringWithFormat:@"Failed to stop local recording: %ld", (long)result], nil);
@@ -86,7 +86,7 @@ @implementation WebRTCModule (RTCAudioDeviceModule)
8686
: (RCTPromiseRejectBlock)reject) {
8787
NSInteger result = [self.audioDeviceModule setMicrophoneMuted:muted];
8888
if (result == 0) {
89-
resolve(@{@"success" : @YES, @"muted" : @(muted)});
89+
resolve(nil);
9090
} else {
9191
reject(@"mute_error", [NSString stringWithFormat:@"Failed to set microphone mute: %ld", (long)result], nil);
9292
}
@@ -104,7 +104,7 @@ @implementation WebRTCModule (RTCAudioDeviceModule)
104104
: (RCTPromiseRejectBlock)reject) {
105105
NSInteger result = [self.audioDeviceModule setVoiceProcessingEnabled:enabled];
106106
if (result == 0) {
107-
resolve(@{@"success" : @YES, @"enabled" : @(enabled)});
107+
resolve(nil);
108108
} else {
109109
reject(@"voice_processing_error",
110110
[NSString stringWithFormat:@"Failed to set voice processing: %ld", (long)result],
@@ -127,7 +127,7 @@ @implementation WebRTCModule (RTCAudioDeviceModule)
127127

128128
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(audioDeviceModuleSetVoiceProcessingAGCEnabled : (BOOL)enabled) {
129129
self.audioDeviceModule.voiceProcessingAGCEnabled = enabled;
130-
return @{@"success" : @YES, @"enabled" : @(enabled)};
130+
return nil;
131131
}
132132

133133
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(audioDeviceModuleIsVoiceProcessingAGCEnabled) {
@@ -156,7 +156,7 @@ @implementation WebRTCModule (RTCAudioDeviceModule)
156156
: (RCTPromiseRejectBlock)reject) {
157157
NSInteger result = [self.audioDeviceModule setMuteMode:(RTCAudioEngineMuteMode)mode];
158158
if (result == 0) {
159-
resolve(@{@"success" : @YES, @"mode" : @(mode)});
159+
resolve(nil);
160160
} else {
161161
reject(@"mute_mode_error", [NSString stringWithFormat:@"Failed to set mute mode: %ld", (long)result], nil);
162162
}
@@ -168,7 +168,7 @@ @implementation WebRTCModule (RTCAudioDeviceModule)
168168

169169
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(audioDeviceModuleSetAdvancedDuckingEnabled : (BOOL)enabled) {
170170
self.audioDeviceModule.advancedDuckingEnabled = enabled;
171-
return @{@"success" : @YES, @"enabled" : @(enabled)};
171+
return nil;
172172
}
173173

174174
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(audioDeviceModuleIsAdvancedDuckingEnabled) {
@@ -177,7 +177,7 @@ @implementation WebRTCModule (RTCAudioDeviceModule)
177177

178178
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(audioDeviceModuleSetDuckingLevel : (NSInteger)level) {
179179
self.audioDeviceModule.duckingLevel = level;
180-
return @{@"success" : @YES, @"level" : @(level)};
180+
return nil;
181181
}
182182

183183
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(audioDeviceModuleGetDuckingLevel) {

src/AudioDeviceModule.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class AudioDeviceModule {
1717
/**
1818
* Start audio playback
1919
*/
20-
static async startPlayout(): Promise<{ success: boolean }> {
20+
static async startPlayout(): Promise<void> {
2121
if (Platform.OS === 'android') {
2222
throw new Error('AudioDeviceModule is only available on iOS/macOS');
2323
}
@@ -28,7 +28,7 @@ export class AudioDeviceModule {
2828
/**
2929
* Stop audio playback
3030
*/
31-
static async stopPlayout(): Promise<{ success: boolean }> {
31+
static async stopPlayout(): Promise<void> {
3232
if (Platform.OS === 'android') {
3333
throw new Error('AudioDeviceModule is only available on iOS/macOS');
3434
}
@@ -39,7 +39,7 @@ export class AudioDeviceModule {
3939
/**
4040
* Start audio recording
4141
*/
42-
static async startRecording(): Promise<{ success: boolean }> {
42+
static async startRecording(): Promise<void> {
4343
if (Platform.OS === 'android') {
4444
throw new Error('AudioDeviceModule is only available on iOS/macOS');
4545
}
@@ -50,7 +50,7 @@ export class AudioDeviceModule {
5050
/**
5151
* Stop audio recording
5252
*/
53-
static async stopRecording(): Promise<{ success: boolean }> {
53+
static async stopRecording(): Promise<void> {
5454
if (Platform.OS === 'android') {
5555
throw new Error('AudioDeviceModule is only available on iOS/macOS');
5656
}
@@ -61,7 +61,7 @@ export class AudioDeviceModule {
6161
/**
6262
* Initialize and start local audio recording (calls initAndStartRecording)
6363
*/
64-
static async startLocalRecording(): Promise<{ success: boolean }> {
64+
static async startLocalRecording(): Promise<void> {
6565
if (Platform.OS === 'android') {
6666
throw new Error('AudioDeviceModule is only available on iOS/macOS');
6767
}
@@ -72,7 +72,7 @@ export class AudioDeviceModule {
7272
/**
7373
* Stop local audio recording
7474
*/
75-
static async stopLocalRecording(): Promise<{ success: boolean }> {
75+
static async stopLocalRecording(): Promise<void> {
7676
if (Platform.OS === 'android') {
7777
throw new Error('AudioDeviceModule is only available on iOS/macOS');
7878
}
@@ -83,7 +83,7 @@ export class AudioDeviceModule {
8383
/**
8484
* Mute or unmute the microphone
8585
*/
86-
static async setMicrophoneMuted(muted: boolean): Promise<{ success: boolean; muted: boolean }> {
86+
static async setMicrophoneMuted(muted: boolean): Promise<void> {
8787
if (Platform.OS === 'android') {
8888
throw new Error('AudioDeviceModule is only available on iOS/macOS');
8989
}
@@ -105,7 +105,7 @@ export class AudioDeviceModule {
105105
/**
106106
* Enable or disable voice processing (requires engine restart)
107107
*/
108-
static async setVoiceProcessingEnabled(enabled: boolean): Promise<{ success: boolean; enabled: boolean }> {
108+
static async setVoiceProcessingEnabled(enabled: boolean): Promise<void> {
109109
if (Platform.OS === 'android') {
110110
throw new Error('AudioDeviceModule is only available on iOS/macOS');
111111
}
@@ -149,7 +149,7 @@ export class AudioDeviceModule {
149149
/**
150150
* Enable or disable Automatic Gain Control (AGC)
151151
*/
152-
static setVoiceProcessingAGCEnabled(enabled: boolean): { success: boolean; enabled: boolean } {
152+
static setVoiceProcessingAGCEnabled(enabled: boolean): void {
153153
if (Platform.OS === 'android') {
154154
throw new Error('AudioDeviceModule is only available on iOS/macOS');
155155
}
@@ -204,7 +204,7 @@ export class AudioDeviceModule {
204204
/**
205205
* Set the microphone mute mode
206206
*/
207-
static async setMuteMode(mode: AudioEngineMuteMode): Promise<{ success: boolean; mode: AudioEngineMuteMode }> {
207+
static async setMuteMode(mode: AudioEngineMuteMode): Promise<void> {
208208
if (Platform.OS === 'android') {
209209
throw new Error('AudioDeviceModule is only available on iOS/macOS');
210210
}
@@ -226,7 +226,7 @@ export class AudioDeviceModule {
226226
/**
227227
* Enable or disable advanced audio ducking
228228
*/
229-
static setAdvancedDuckingEnabled(enabled: boolean): { success: boolean; enabled: boolean } {
229+
static setAdvancedDuckingEnabled(enabled: boolean): void {
230230
if (Platform.OS === 'android') {
231231
throw new Error('AudioDeviceModule is only available on iOS/macOS');
232232
}
@@ -248,7 +248,7 @@ export class AudioDeviceModule {
248248
/**
249249
* Set the audio ducking level (0-100)
250250
*/
251-
static setDuckingLevel(level: number): { success: boolean; level: number } {
251+
static setDuckingLevel(level: number): void {
252252
if (Platform.OS === 'android') {
253253
throw new Error('AudioDeviceModule is only available on iOS/macOS');
254254
}

0 commit comments

Comments
 (0)