Can anyone help? I am recording raw audio data to a file using CRecordAudioInputStream. I now want to convert the raw audio data to a wave file format and possibly other file formats, using the CMdaAudioConvertUtility. I keep getting KErrNotSupported when I call OpenL(..), to open the audio conversion utility. I am testing this on the PC emulator and on a 6300 phone. Here is the code I am using
CMdaAudioConvertUtility* CMediaFileConverter::ConstructL(const TDesC& aSourceFile, const TDesC& aTargetFile)
{
TMdaFileClipLocation *SrcFile = new(ELeave) TMdaFileClipLocation(aSourceFile);
TMdaFileClipLocation *DestFile = new(ELeave) TMdaFileClipLocation(aTargetFile);
SrcFile.iName = aSourceFile;
DestFile.iName = aTargetFile;
TMdaClipFormat* SrcFormat = new(ELeave) TMdaRawAudioClipFormat;
TMdaClipFormat* DestFormat = new(ELeave) TMdaWavClipFormat;
TMdaRawAudioClipFormat *SrcCodec = new(ELeave)TMdaRawAudioCodec();
TMdaPcmWavCodec *DestCodec = new(ELeave)TMdaPcmWavCodec();
TMdaAudioDataSettings SrcSettings;
TMdaAudioDataSettings DestSettings;
SrcSettings.iChannels = 1;//TMdaAudioDataSettings::EChannelsMono;
SrcSettings.iSampleRate = 8000;//TMdaAudioDataSettings::ESampleRate8000Hz;
DestSettings.iChannels = TMdaAudioDataSettings::EChannelsMono;
DestSettings.iSampleRate = TMdaAudioDataSettings::ESampleRate8000Hz;
TRAP((err, iMediaFileConvertUtility->OpenL(&SrcFile, &DestFile, SrcFormat, DestFormat, SrcCodec, &SrcSettings, DestCodec, &DestSettings));
return iMediaFileConvertUtility;
}
Could somebody please tell where I am doing wrong and show me how to get it right.
Thanks in advance
rastapasta



