[IMPROVE] Voice messages improvements (#3385)

Co-authored-by: Diego Mello <diegolmello@gmail.com>
Co-authored-by: Marco Jacotec <mj@jacotec.de>
This commit is contained in:
Gerzon Z 2021-09-21 10:47:00 -04:00 committed by GitHub
parent 4eb42d70b9
commit 0871849de8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View File

@ -17,11 +17,11 @@ interface IMessageBoxRecordAudioProps {
onFinish: Function;
}
const RECORDING_EXTENSION = '.aac';
const RECORDING_EXTENSION = '.m4a';
const RECORDING_SETTINGS = {
android: {
extension: RECORDING_EXTENSION,
outputFormat: Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AAC_ADTS,
outputFormat: Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_MPEG_4,
audioEncoder: Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AAC,
sampleRate: Audio.RECORDING_OPTIONS_PRESET_LOW_QUALITY.android.sampleRate,
numberOfChannels: Audio.RECORDING_OPTIONS_PRESET_LOW_QUALITY.android.numberOfChannels,
@ -39,7 +39,7 @@ const RECORDING_SETTINGS = {
const RECORDING_MODE = {
allowsRecordingIOS: true,
playsInSilentModeIOS: true,
staysActiveInBackground: false,
staysActiveInBackground: true,
shouldDuckAndroid: true,
playThroughEarpieceAndroid: false,
interruptionModeIOS: Audio.INTERRUPTION_MODE_IOS_DO_NOT_MIX,
@ -147,7 +147,7 @@ export default class RecordAudio extends React.PureComponent<IMessageBoxRecordAu
const fileURI = this.recording.getURI();
const fileData = await getInfoAsync(fileURI);
const fileInfo = {
name: `${Date.now()}.aac`,
name: `${Date.now()}.m4a`,
mime: 'audio/aac',
type: 'audio/aac',
store: 'Uploads',

View File

@ -43,7 +43,7 @@ interface IMessageAudioState {
const mode = {
allowsRecordingIOS: false,
playsInSilentModeIOS: true,
staysActiveInBackground: false,
staysActiveInBackground: true,
shouldDuckAndroid: true,
playThroughEarpieceAndroid: false,
interruptionModeIOS: Audio.INTERRUPTION_MODE_IOS_DO_NOT_MIX,

View File

@ -103,6 +103,7 @@
</dict>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
<string>fetch</string>
<string>voip</string>
</array>