从麦克风录制时将.pcm转换为aac

时间:2015-09-15 13:19:50

标签: android mediacodec pcm android-audiorecord mediamuxer

我有一个程序可以录制麦克风的声音并将声音保存在.pcm文件中。

我在程序中有一个单独的函数,它使用MediaCodec和MediaMuxer将.pcm转换为aac。

是否可以修改我的程序,以便使用MediaCodec直接将.pcm转换为aac?我该怎么办?是否有指南或是否有代码示例?

这是我程序中的代码片段,用于记录来自的声音 麦克风:

$xmlData = file_get_contents('searchRequest.xml');
$rCurlSession = curl_init();
curl_setopt($rCurlSession, CURLOPT_URL, 'http://somedomain/services/Service');
curl_setopt($rCurlSession, CURLOPT_HEADER, true);
curl_setopt($rCurlSession, CURLOPT_RETURNTRANSFER, true);
curl_setopt($rCurlSession, CURLOPT_POST, true);
curl_setopt($rCurlSession, CURLOPT_POSTFIELDS, $xmlData);
$aHeaders = array(
    'Content-Type: text/xml;charset=UTF-8',
    'SOAPAction: textSearchAction',
    'Content-length: '.strlen($xmlData),
);

curl_setopt($rCurlSession, CURLOPT_HTTPHEADER, $aHeaders);
$sResponse = curl_exec($rCurlSession);

0 个答案:

没有答案
相关问题