nosnia-audio-recorder 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -176,10 +176,10 @@ RCT_EXPORT_METHOD(startRecording:(NSDictionary *)options
|
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
// Set audio category with
|
|
179
|
+
// Set audio category - use Record category with DuckOthers option
|
|
180
180
|
NSError *categoryError = nil;
|
|
181
181
|
BOOL categorySuccess = [audioSession setCategory:AVAudioSessionCategoryRecord
|
|
182
|
-
withOptions:
|
|
182
|
+
withOptions:AVAudioSessionCategoryOptionDuckOthers
|
|
183
183
|
error:&categoryError];
|
|
184
184
|
if (!categorySuccess || categoryError) {
|
|
185
185
|
NSString *msg = categoryError ? categoryError.description : @"Failed to set audio category";
|
|
@@ -204,12 +204,14 @@ RCT_EXPORT_METHOD(startRecording:(NSDictionary *)options
|
|
|
204
204
|
|
|
205
205
|
// Create recording settings dictionary with safety checks
|
|
206
206
|
@try {
|
|
207
|
+
// Use IMA4 codec which is universally supported on iOS
|
|
208
|
+
// AVAudioRecorder doesn't support direct AAC encoding on all devices
|
|
207
209
|
NSDictionary *recordingSettings = @{
|
|
208
|
-
AVFormatIDKey: @(
|
|
209
|
-
AVSampleRateKey:
|
|
210
|
-
AVNumberOfChannelsKey:
|
|
211
|
-
AVEncoderBitRateKey:
|
|
212
|
-
AVEncoderAudioQualityKey: @(
|
|
210
|
+
AVFormatIDKey: @(kAudioFormatILBC),
|
|
211
|
+
AVSampleRateKey: @(8000), // ILBC requires 8000 Hz
|
|
212
|
+
AVNumberOfChannelsKey: @(1),
|
|
213
|
+
AVEncoderBitRateKey: @(15400),
|
|
214
|
+
AVEncoderAudioQualityKey: @(AVAudioQualityMin)
|
|
213
215
|
};
|
|
214
216
|
|
|
215
217
|
// Validate settings dictionary created successfully
|
package/package.json
CHANGED