Embedding tone sound in cocos2dx for Win32
I am using cocos2dx SimpleAudioEngine. (I need to use this, not the new AudioEngine).
I tried to implement pitch function for SimpleAudioEngine for Win32, but I'm stuck.
cocos2dx uses MCI to play audio when using SimpleAudioEngine. (MCI ref: https://msdn.microsoft.com/en-us/library/windows/desktop/dd742874(v=vs.85).aspx ).
I cannot figure out how to implement the pitch function. There is also setVolume, but the implementation is empty too (the cocos2dx guys didn't implement this I guess). I am using cocos2d-x v.3.3 C ++. I found out that there is a dwSpeed ββvariable that can be used to change the playback speed, but I can't figure out how to work with that.
Here's what I did:
void MciPlayer::SetSpeed(DWORD dwSpeed)
{
tagMCI_VD_PLAY_PARMS mciSetParms;
DWORD dwFlags;
if (!_dev)
return ;
mciSetParms.dwSpeed = dwSpeed;
mciSendCommand(_dev, MCI_PLAY, MCI_FROM|MCI_NOTIFY,
reinterpret_cast<DWORD_PTR> (&mciSetParms));
}
And here is the cpp file for MciPlayer: http://pastebin.com/BNyC7FEK
Is there a chance to implement the step in this particular case? Or does MCI not support this? If any MCI comes out, please help!
This is a pretty daunting task, I think.
Thank you for your time!
Chris
source to share
No one has answered this question yet
Check out similar questions: