[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;
|
onFinish: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
const RECORDING_EXTENSION = '.aac';
|
const RECORDING_EXTENSION = '.m4a';
|
||||||
const RECORDING_SETTINGS = {
|
const RECORDING_SETTINGS = {
|
||||||
android: {
|
android: {
|
||||||
extension: RECORDING_EXTENSION,
|
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,
|
audioEncoder: Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AAC,
|
||||||
sampleRate: Audio.RECORDING_OPTIONS_PRESET_LOW_QUALITY.android.sampleRate,
|
sampleRate: Audio.RECORDING_OPTIONS_PRESET_LOW_QUALITY.android.sampleRate,
|
||||||
numberOfChannels: Audio.RECORDING_OPTIONS_PRESET_LOW_QUALITY.android.numberOfChannels,
|
numberOfChannels: Audio.RECORDING_OPTIONS_PRESET_LOW_QUALITY.android.numberOfChannels,
|
||||||
|
@ -39,7 +39,7 @@ const RECORDING_SETTINGS = {
|
||||||
const RECORDING_MODE = {
|
const RECORDING_MODE = {
|
||||||
allowsRecordingIOS: true,
|
allowsRecordingIOS: true,
|
||||||
playsInSilentModeIOS: true,
|
playsInSilentModeIOS: true,
|
||||||
staysActiveInBackground: false,
|
staysActiveInBackground: true,
|
||||||
shouldDuckAndroid: true,
|
shouldDuckAndroid: true,
|
||||||
playThroughEarpieceAndroid: false,
|
playThroughEarpieceAndroid: false,
|
||||||
interruptionModeIOS: Audio.INTERRUPTION_MODE_IOS_DO_NOT_MIX,
|
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 fileURI = this.recording.getURI();
|
||||||
const fileData = await getInfoAsync(fileURI);
|
const fileData = await getInfoAsync(fileURI);
|
||||||
const fileInfo = {
|
const fileInfo = {
|
||||||
name: `${Date.now()}.aac`,
|
name: `${Date.now()}.m4a`,
|
||||||
mime: 'audio/aac',
|
mime: 'audio/aac',
|
||||||
type: 'audio/aac',
|
type: 'audio/aac',
|
||||||
store: 'Uploads',
|
store: 'Uploads',
|
||||||
|
|
|
@ -43,7 +43,7 @@ interface IMessageAudioState {
|
||||||
const mode = {
|
const mode = {
|
||||||
allowsRecordingIOS: false,
|
allowsRecordingIOS: false,
|
||||||
playsInSilentModeIOS: true,
|
playsInSilentModeIOS: true,
|
||||||
staysActiveInBackground: false,
|
staysActiveInBackground: true,
|
||||||
shouldDuckAndroid: true,
|
shouldDuckAndroid: true,
|
||||||
playThroughEarpieceAndroid: false,
|
playThroughEarpieceAndroid: false,
|
||||||
interruptionModeIOS: Audio.INTERRUPTION_MODE_IOS_DO_NOT_MIX,
|
interruptionModeIOS: Audio.INTERRUPTION_MODE_IOS_DO_NOT_MIX,
|
||||||
|
|
|
@ -103,6 +103,7 @@
|
||||||
</dict>
|
</dict>
|
||||||
<key>UIBackgroundModes</key>
|
<key>UIBackgroundModes</key>
|
||||||
<array>
|
<array>
|
||||||
|
<string>audio</string>
|
||||||
<string>fetch</string>
|
<string>fetch</string>
|
||||||
<string>voip</string>
|
<string>voip</string>
|
||||||
</array>
|
</array>
|
||||||
|
|
Loading…
Reference in New Issue