[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:
parent
4eb42d70b9
commit
0871849de8
|
@ -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',
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -103,6 +103,7 @@
|
|||
</dict>
|
||||
<key>UIBackgroundModes</key>
|
||||
<array>
|
||||
<string>audio</string>
|
||||
<string>fetch</string>
|
||||
<string>voip</string>
|
||||
</array>
|
||||
|
|
Loading…
Reference in New Issue