WEB开发网
开发学院手机开发Symbian 开发 Symbian中音频API的运用 阅读

Symbian中音频API的运用

 2010-07-22 01:41:00 来源:WEB开发网   
核心提示:aPreviousState, TInt aCurrentState, TInt aErrorCode) *//*there are several ways to record to a file by the CMdaAudioRecorderUtility:(1). use OpenFileL()if we us
aPreviousState, TInt aCurrentState, TInt aErrorCode) */

/*

there are several ways to record to a file by the CMdaAudioRecorderUtility:

(1). use OpenFileL()

if we use this method, then the file must all ready exist, and just creating a new file using RFile.CreateL() or RFile.ReplaceL() will not be accepted by the recorder utility therefore, this would put a limit on how many messages could be kept

(2). use OpenL()

if we use this method, then the file name passed to it, will lead it to construct a new file with this filename or it will overwrite an existing file with that name however, in order to use this function, we need to pass in several objects:

(1) file location.

(2) file format to be recorded, this is populated by the function.

(3) recording codec to use.

(4) audio settings, such as sample rate and number of channels.

void CAnsPhoneEngine::MoscoStateChangeEvent(CBase* aObject, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode)

{

// if the recording has died, this means that the recording should be finished;

// should only happen when recording on the telephony line

if(iState == ERecord && !iIsLocal && aErrorCode == KErrDied)

{

Stop();

return;

}

User::LeaveIfError(aErrorCode);

if(aCurrentState != CMdaAudioClipUtility::EOpen)

return;

switch(iState)

{

case ERecordInit:

// 设置为电话线路上的记录并设置为最大增益

if(iIsLocal) /* if aIsLocal = ETrue, then record to the user's message; use the telephony line. */

{

iSound->SetAudioDeviceMode(CMdaAudioRecorderUtility::ELocal); /* CMdaAudioRecorderUtility::TDeviceMode是音频设备模式,指定录音和播放所使用的设备 */

iSound->SetGain(iSound->MaxGain());

上一页  1 2 3 4 5 6 7 8  下一页

Tags:Symbian 音频 API

编辑录入:coldstar [复制链接] [打 印]
赞助商链接