[REGRESSION] Audio Recording (#2240)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
parent
c1f3f89c09
commit
f4118b6312
|
@ -94,9 +94,6 @@ export default class extends React.PureComponent {
|
||||||
if (!didSucceed) {
|
if (!didSucceed) {
|
||||||
return onFinish && onFinish(didSucceed);
|
return onFinish && onFinish(didSucceed);
|
||||||
}
|
}
|
||||||
if (isAndroid) {
|
|
||||||
filePath = filePath.startsWith('file://') ? filePath : `file://${ filePath }`;
|
|
||||||
}
|
|
||||||
const fileInfo = {
|
const fileInfo = {
|
||||||
name: this.name,
|
name: this.name,
|
||||||
mime: 'audio/aac',
|
mime: 'audio/aac',
|
||||||
|
@ -111,8 +108,9 @@ export default class extends React.PureComponent {
|
||||||
finishAudioMessage = async() => {
|
finishAudioMessage = async() => {
|
||||||
try {
|
try {
|
||||||
this.recording = false;
|
this.recording = false;
|
||||||
const filePath = await AudioRecorder.stopRecording();
|
let filePath = await AudioRecorder.stopRecording();
|
||||||
if (isAndroid) {
|
if (isAndroid) {
|
||||||
|
filePath = filePath.startsWith('file://') ? filePath : `file://${ filePath }`;
|
||||||
const data = await FileSystem.getInfoAsync(decodeURIComponent(filePath), { size: true });
|
const data = await FileSystem.getInfoAsync(decodeURIComponent(filePath), { size: true });
|
||||||
this.finishRecording(true, filePath, data.size);
|
this.finishRecording(true, filePath, data.size);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue