WEB开发网
开发学院手机开发Symbian 开发 symbian中打开wav mp3等音频文件 阅读

symbian中打开wav mp3等音频文件

 2010-06-22 02:48:00 来源:WEB开发网   
核心提示:#include "player.h"#include //for CompleteWithAppPathCSampleAudio* CSampleAudio::NewL(){CSampleAudio* audio = CSampleAudio::NewLC();CleanupStack::Pop(

#include "player.h"

#include //for CompleteWithAppPath

CSampleAudio* CSampleAudio::NewL()

{

CSampleAudio* audio = CSampleAudio::NewLC();

CleanupStack::Pop();

return audio;

}

CSampleAudio* CsampleAudio::NewL()

{

CSampleAudio* audio = new(ELeave)CSampleAudio();

CleanupStack::PushL(audio);

audio->ConstructL();

return audio;

}

CSampleAudio::~CSampleAudio()

{

if(iPlayer)

{

delete iPlayer;

iPlayer = NULL;

}

}

CSampleAudio::CSampleAudio()

{

}

void CSampleAudio::ConstructL()

{

}

void CSampleAudio::PlayingAudioL(const TDesC& aFileName)

{

TFileName filepath(CompleteWithAppPath(aFileName));

iPlayer = CMdaAudioPlayerUtility::NewFilePlayerL(filepath, *this);

}

void CSampleAudio::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds &aDuration)

{

if(aError == KErrNone)

{

iPlayer->SetVolume(iPlayer->MaxVolume());

iPlayer->Play();

}

else

{

// log error

}

}

void CSampleAudio::MapcPlayComplete(TInt aError)

{

if (aError == KErrNone)

{

// do something, if necessary

}

else

{

iPlayer->Stop();

}

}

上一页  1 2 

Tags:symbian 打开 wav

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