Skip to content

Commit f316c9d

Browse files
committed
fix: try forcing quality to medium
1 parent 7a2f221 commit f316c9d

2 files changed

Lines changed: 1 addition & 25 deletions

File tree

package/native-package/src/optionalDependencies/Audio.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -111,30 +111,15 @@ class _Audio {
111111
audioSet: {
112112
// Android specific properties
113113
AudioEncoderAndroid: AudioEncoderAndroidType.AAC,
114-
// Pin nitro-sound 0.2.10+'s bitrate to 128 kbps. Its `.high` quality
115-
// preset otherwise defaults to (48 kHz, 2ch, 192 kbps), a combination
116-
// the iOS hardware AAC encoder rejects with
117-
// kAudioFormatUnsupportedDataFormatError ('fmt?', OSStatus 1718449215)
118-
// in AppStore signed binaries.
119-
// https://www.osstatus.com/search/results?search=1718449215
120-
// Older nitro-sound and the legacy `react-native-audio-recorder-player`
121-
// ignore this key.
122-
AudioEncodingBitRate: 128000,
123114
AudioSourceAndroid: AudioSourceAndroidType.MIC,
124115
OutputFormatAndroid: OutputFormatAndroidType.AAC_ADTS,
125116

126117
// iOS specific properties
127-
AVEncoderAudioQualityKeyIOS: AVEncoderAudioQualityIOSType.high,
118+
AVEncoderAudioQualityKeyIOS: AVEncoderAudioQualityIOSType.medium,
128119
AVFormatIDKeyIOS: AVEncodingOption.aac,
129120
AVModeIOS: AudioRecorderPackageNitroSound
130121
? AVModeIOSOptionNitroSound.spokenaudio
131122
: AVModeIOSOption.spokenaudio,
132-
AVNumberOfChannelsKeyIOS: 2,
133-
// Pair with `AudioEncodingBitRate` above override nitro-sound 0.2.10+'s
134-
// 48 kHz default back to 44.1 kHz so the encoder gets the combo that
135-
// 0.2.9 was implicitly using. Idempotent for older nitro-sound and the
136-
// legacy lib (their default is already 44.1 kHz).
137-
AVSampleRateKeyIOS: 44100,
138123
},
139124
isMeteringEnabled: true,
140125
},

package/src/types/types.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -501,15 +501,6 @@ type AVEncodingType =
501501
export interface AudioSet {
502502
AudioChannelsAndroid?: number;
503503
AudioEncoderAndroid?: AudioEncoderAndroidType;
504-
/**
505-
* Cross-platform bitrate hint introduced in `react-native-nitro-sound` 0.2.10+.
506-
* Sits alongside the iOS-native `AVEncoderBitRateKeyIOS` because nitro-sound
507-
* reads `AudioEncodingBitRate` on iOS (mapping it to `AVEncoderBitRateKey`),
508-
* not the platform-specific key. Older nitro-sound builds and the legacy
509-
* `react-native-audio-recorder-player` ignore this field, so it's safe to
510-
* include unconditionally.
511-
*/
512-
AudioEncodingBitRate?: number;
513504
AudioEncodingBitRateAndroid?: number;
514505
AudioSamplingRateAndroid?: number;
515506
AudioSourceAndroid?: AudioSourceAndroidType;

0 commit comments

Comments
 (0)