-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File upload's type is GP, not mp4/m4a although file's tag is mp4/m4a, and can't play this audio from url #78
Comments
I hope you could provide more example to help you out. |
Here is audio's url: http://118.70.180.81:8055/UserAudio/74fca23d-fc54-4b5d-9213-1d220abaf22a/2019/6/1560826688hccqb0.m4a when i post the audio file recored. I converted this file to base64 and saw: |
I tried react-native-audio and it worked perpectly |
@Hieutt1704 I hope you can provide us clearer example (maybe some code) so that I can do some work on improving our module. |
Here is the code record audio: onStartRecord = async () => {const result = await this.audioRecorderPlayer.startRecorder();this.setState({ uri_audio: result, startRecord: true })this.audioRecorderPlayer.addRecordBackListener(e => {if (this.state.recordSecs == 12) {this.onStopRecord();Utils.showToast(I18n.t("limit_record"));} elsethis.setState({recordSecs: (e.current_position / 1000).toFixed(0),});return;});};onStopRecord = async () => {const { recordSecs, uri_audio, startRecord } = this.stateif (!startRecord) returnawait this.audioRecorderPlayer.stopRecorder();const content = {currentPositionSec: 0,recordSecs: 0,startRecord: false,duration: recordSecs,uri_audio,startPlay: false,playTime: 0,}this.setState(content)};Here is the code,that I post audio file to server: const dataAudio = {uri: this.state.uri_audio,type: Platform.OS == 'ios' ? 'audio/m4a' : 'audio/mp4',name: Platform.OS == 'ios' ? 'sound.m4a' : 'sound.mp4',}const data = new FormData()data.append("content", dataAudio)res = await Apis.createAudio(data)Here is the audio' url after fetch api: |
You now can pass various variables when |
Version of react-native-audio-recorder-player: 2.1.2
Platforms you faced the error (IOS or Android or both?): both
React-native 0.59.5
The text was updated successfully, but these errors were encountered: