Symbian S60 mp3解压(解码)与混音解决方案(含源代码)
来源:互联网 发布:知乎 日本 编辑:程序博客网 时间:2024/06/10 22:11
Symbian S60 MP3 decoding & sound mixing solution.
Official website: http://www.wanwann.com/2010/02/21/symbian-s60-mp3-decoding-sound-mixing-solution/
preamble:
As we might know, It is not workable to play mutiple music file allat once on the symbian s60 platform, for the latter would preempt theaudio device of the previous one(However, It’s workable if we have amusic file player and another stream player, here, I mean music fileplayer by playing some music by using the CMdaAudioPlayerUtility::de>OpenFileL()de>, or some similiar operation, stream player by playing some music by using the CMdaAudioInputStream::de>Open() de> or some operation like that.)
So what if we wanna play multiple music or sound at the some time?What if we wanna play some background music, and at this moment, wewanna have some sound effect in our game? If you try by using severalmusic file player, I bet, you would have to stop the others while someis playing. This sounds no good, as it might be too difficult tocontrol and also, the effect would be not as good as you expect.
Well, here provides a solution to you, that you can decode yourmp3 to raw music datas, and then mixing then play(by using a singlestreamming player) these decoded raw datas. However, this solution isan opensource project which is licenced under the GPL licence, pleaseagree to the license before you use the sourcecodes.
How did it work?
We use an open-sourced mp3 decoding library, madlib for mp3decoding. For mixing play, we register an channel everytime we’d liketo play one music(sound).
How do I get started?
We provide a demo here, so you can learn how to use it.
For decoding, just create an instance of class CMp3ToRawdataDecoder, then set your resample rate, then decode.
iDecoder1 = CMp3ToRawdataDecoder::NewL(iObserver); // The observer to observe this decoding process
iDecoder1->SetResampleRate(44100);
TFileName srcFile = KSrcFilePath; // The source mp3 file to be decoded
TFileName destFile = KDestFilePath; // The file path where the decoded raw datas will be saved
iDecoder1->StartDecode(srcFile, destFile);
If the decoding process succeeds, the DecodeComplete(constTFileName& aSrcFileName, const TFileName& aDestFileName) of theobserver class will be called, otherwise, the ReportError(constTFileName& aSrcFile, const TFileName& aDestFileName, TIntaErrorCode) of the observer class would be called.
For mixing play, just create an instance of class CMixingPlayer, then play.
iMixingPlayer = CMixingPlayer::NewL();
iMixingPlayer->play(aDestFileName1, 100, FALSE);
If you wanna play another music, easy, just call play again.
iMixingPlayer->play(aDestFileName2, 100, FALSE);
Downloads
The Solution Library is downloadable here.
The Solution Demo is downloadable here.
- Symbian S60 mp3解压(解码)与混音解决方案(含源代码)
- Symbian s60入门(转载)
- ARM MP3解码源代码
- symbian s60平台的H264编解码
- symbian 来电拦截(S60 3rd)
- [S60]symbian基本类型转换 (转载)
- 基于symbian s60 开发的纸牌游戏(part 1)
- Symbian S60系列---PKG文件范例详解(一)
- Symbian S60系列---PKG文件范例详解(二)
- htmlcontrol-for-symbian(S60 5th)滑动
- Symbian S60平台开发环境搭建(for java)
- MP3解码--怎样解码mp3音频流,MP3Decoder(MP3流解码代码库)-《零度屏幕录像软件》
- symbian s60 目录与文件新建
- Symbian S60第三版手机最基本常见问题及解决方案
- Base64编码/解码(源代码)
- C#生成二维码(含解码)
- symbian s60 将一个带有目录的zip文件解压到指定目录
- UDA1341声卡驱动与madplay移植播放mp3(第三方源代码移植步骤)
- Cocos2d制作的简单iphone游戏--转
- [转] 用 SWIG 构建 PHP 扩展
- nginx 的gzip 导致 js 里面的iframe 的奇异问题
- GCC-3.4.6源代码学习笔记(9)
- javah -jni编译带包的class文件出错
- Symbian S60 mp3解压(解码)与混音解决方案(含源代码)
- 创建新工程与新类
- 开学了!
- asdasdasd
- Studying note of GCC-3.4.6 source (9)
- The font problem in english XPE images
- pku1678 I Love this Game!
- InstallShield 2009制作安装包注意事项
- 麦田的读书生活