cocos2d-x 3.0
- 首页 - 相关页面 - 模块 - 命名空间 - - 文件 -
类 - 图1 类 - 图2)
- 文件列表 - 文件成员

全部)) 命名空间) 文件) 函数) 变量) 类型定义) 枚举) 枚举值) 属性) 友元) 宏定义)))

| 宏定义 | 枚举 | 变量

CocosDenshion.h 文件参考

IMPORTANT There are 3 different ways of using CocosDenshion. 更多…

#import

#import

#import

#import

#import "CDConfig.h"

#import "CDOpenALSupport.h"

##
struct sourceGroup
struct bufferInfo
struct sourceInfo
protocol <CDAudioTransportProtocol>
protocol <CDAudioInterruptProtocol>
class CDUtilities
Collection of utilities required by CocosDenshion. 更多…
class CDSoundEngine
class CDSoundSource
CDSoundSource is a wrapper around an OpenAL sound source. 更多…
class CDAudioInterruptTargetGroup
Container for objects that implement audio interrupt protocol i.e. 更多…
class CDAsynchBufferLoader
CDAsynchBufferLoader TODO. 更多…
class CDBufferLoadRequest
CDBufferLoadRequest. 更多…
class CDFloatInterpolator
class CDPropertyModifier
Base class for classes that modify properties such as pitch, pan and gain. 更多…
class CDSoundSourceFader
Fader for CDSoundSource objects. 更多…
class CDSoundSourcePanner
Panner for CDSoundSource objects. 更多…
class CDSoundSourcePitchBender
Pitch bender for CDSoundSource objects. 更多…
class CDSoundEngineFader
Fader for CDSoundEngine objects. 更多…
## 宏定义
#define CDLOG(…) do {} while (0)
#define CDLOGINFO(…) do {} while (0)
#define CD_SOURCE_LIMIT 32
#define CD_NO_SOURCE 0xFEEDFAC
#define CD_IGNORE_AUDIO_SESSION 0xBEEFBEE
#define CD_MUTE 0xFEEDBAB
#define CD_NO_SOUND = -1;
#define CD_SAMPLE_RATE_HIGH 44100
#define CD_SAMPLE_RATE_MID 22050
#define CD_SAMPLE_RATE_LOW 16000
#define CD_SAMPLE_RATE_BASIC 8000
#define CD_SAMPLE_RATE_DEFAULT 44100
## 枚举
enum bufferState { CD_BS_EMPTY = 0, CD_BS_LOADED = 1, CD_BS_FAILED = 2, CD_BS_EMPTY = 0, CD_BS_LOADED = 1, CD_BS_FAILED = 2 }
enum tCDInterpolationType { kIT_Linear, kIT_SCurve, kIT_Exponential, kIT_Linear, kIT_SCurve, kIT_Exponential }
Interpolation type. 更多…
## 变量
NSString const kCDN_BadAlContext
NSString const kCDN_AsynchLoadComplete
float const kCD_PitchDefault
float const kCD_PitchLowerOneOctave
float const kCD_PitchHigherOneOctave
float const kCD_PanDefault
float const kCD_PanFullLeft
float const kCD_PanFullRight
float const kCD_GainDefault

详细描述

IMPORTANT There are 3 different ways of using CocosDenshion.

Depending on which you choose you will need to include different files and frameworks.

  • SimpleAudioEngine
  • This is recommended for basic audio requirements. If you just want to play some sound fx and some background music and have no interest in learning the lower level workings then this is the interface to use.

Requirements:

  • CDAudioManager
  • CDAudioManager is basically a thin wrapper around an AVAudioPlayer object used for playing background music and a CDSoundEngine object used for playing sound effects. It manages the audio session for you deals with audio session interruption. It is fairly low level and it is expected you have some understanding of the underlying technologies. For example, for many use cases regarding background music it is expected you will work directly with the backgroundMusic AVAudioPlayer which is exposed as a property.

Requirements:

  • CDSoundEngine
  • CDSoundEngine is a sound engine built upon OpenAL and derived from Apple's oalTouch example. It can playback up to 32 sounds simultaneously with control over pitch, pan and gain. It can be set up to handle audio session interruption automatically. You may decide to use CDSoundEngine directly instead of CDAudioManager or SimpleAudioEngine because you require OS 2.0 compatibility.

Requirements:

  • Firmware: OS 2.0 or greater
  • Files: CocosDenshion.*
  • Frameworks: OpenAL, AudioToolbox

宏定义说明

#define CD_IGNORE_AUDIO_SESSION 0xBEEFBEE

#define CD_MUTE 0xFEEDBAB

#define CD_NO_SOUND = -1;

#define CD_NO_SOURCE 0xFEEDFAC

#define CD_SAMPLE_RATE_BASIC 8000

#define CD_SAMPLE_RATE_DEFAULT 44100

#define CD_SAMPLE_RATE_HIGH 44100

#define CD_SAMPLE_RATE_LOW 16000

#define CD_SAMPLE_RATE_MID 22050

#define CD_SOURCE_LIMIT 32

#define CDLOG ( ) do {} while (0)

#define CDLOGINFO ( ) do {} while (0)

枚举类型说明

enum bufferState
枚举值
CD_BS_EMPTY
CD_BS_LOADED
CD_BS_FAILED
CD_BS_EMPTY
CD_BS_LOADED
CD_BS_FAILED

enum tCDInterpolationType

Interpolation type.

枚举值
kIT_Linear
kIT_SCurve Straight linear interpolation fade.
kIT_Exponential S curved interpolation. Exponential interpolation
kIT_Linear
kIT_SCurve Straight linear interpolation fade.
kIT_Exponential S curved interpolation. Exponential interpolation

变量说明

float const kCD_GainDefault

float const kCD_PanDefault

float const kCD_PanFullLeft

float const kCD_PanFullRight

float const kCD_PitchDefault

float const kCD_PitchHigherOneOctave

float const kCD_PitchLowerOneOctave

NSString* const kCDN_AsynchLoadComplete

NSString* const kCDN_BadAlContext