4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Cocos2d-x SoundEffect 作る方法

Posted at

Cocos2d-x SoundEffect 作る方法について 
 
CODE
SimpleAudioEngine.h
int createEffectWave(float pitch,float pan,float gain);
pitch is 音のスピード pan is 右の音と左の音 gain is声の距離

まず include simpleAudioEngine
#include "SimpleAudioEngine.h"
そして set define the Music of Effect FileURL;
#define SoundWave "sound.mp3"

int IntelligenceMemoryAudioContainer::createEffectWave(float pitch,float pan,float gain){
//必ずpreloadEffectください!
CocosDenshion::SimpleAudioEngine::getInstance()->preloadEffect(PaperWave);
//Volume 

:SimpleAudioEngine::getInstance()->setEffectsVolume(10);
//もし SOUNDID必要な時は この方法でIDをもらう事ができます
return  CocosDenshion::SimpleAudioEngine::getInstance()->playEffect(SoundWave,false,pitch,pan,gain);   
} ```

後は必要の時で使用するのみ!

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?