[英]What format should I record in android to play in ios
Im building an application where Im using cordova media to record audio on both ios and android. 我正在构建一个应用程序,其中我使用科尔多瓦媒体在iOS和Android上录制音频。 I encode the audio to a base64 string and send it to a server (parse.com) and save it as a file. 我将音频编码为base64字符串,然后将其发送到服务器(parse.com),并将其保存为文件。 When I want to play it, I play the url from the file after I click on a button on the devices. 当我想播放时,单击设备上的按钮后,播放文件中的URL。 When I record the audio as a wav file on ios I can play it on both ios and android. 当我在iOS上将音频记录为wav文件时,可以在ios和android上播放它。 But when I record on android I can only play it back on android devices. 但是当我在android上录制时,只能在android设备上播放。
Im struggling to find a format which I can record on android and play it on ios. 我正在努力寻找一种可以在android上录制并在ios上播放的格式。 I have tried wav, mp3, mp4, aac and 3gp. 我已经尝试过WAV,MP3,MP4,AAC和3GP。 I have tried amr as well, but then it looks like it download the file to the phone and that is not what I want to do. 我也尝试过amr,但是看起来它会将文件下载到手机中,这不是我想要的。
Can someone please help, Im really lost here. 有人可以帮忙吗,我真的在这里迷路了。
Here's what I used. 这是我用的。 It plays audio properly in iOS. 它可以在iOS中正常播放音频。
recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
recorder.setAudioSamplingRate(44100);
recorder.setAudioEncodingBitRate(96000);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.