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

+3
c ++ winapi audio cocos2d-x mci


source to share


No one has answered this question yet

Check out similar questions:

1643
Why templates can only be implemented in a header file?
504
Undefined, undefined and implementation-defined behavior
23
Receive feed and convolution from matrix with no features
6
mciSendString won't play audio file if path is too long
1
Win32 PlaySound overlaps audio
1
Adding new methods to Cocos2d-x SimpleAudioEngine
0
C ++ / Win32 - What is causing the delay due to using MCI?
0
Cocos2dx style and implementation
0
Unable to create cocos2dx win32 project
0
Cocos2d-x tv noise effect



All Articles
Loading...
X
Show
Funny
Dev
Pics