Inherits from NSObject
Declared in PXSoundMixer.h
PXSoundMixer.m

Overview

exponent is defined in #PXSoundChannel3D.

Tasks

  • + warmUp

    Initializes the sound engine so that when you go to play a sound there is not the initial delay of setting up the engine. This is suggested to do at the start of your program if you are in need of playing sounds immediately within the duration of your app.

  • + setSoundTransform:

    Changes the pitch and volume of every sound.

  • + soundTransform

    Returns the global sound transform.

  • + soundListener

    Returns the global sound listener.

  • + setSpeedOfSound:

    Sets the speed of sound, this is useful for the doppler effect.

  • + speedOfSound

    Returns the speed of sound.

  • + setDistanceModel:

    Sets the distance model for the sound. This means that the further the sound gets from the listener, how it the volume will change. The two options available are either PXSoundMixerDistanceModel_Linear or PXSoundMixerDistanceModel_Logarithmic.

  • + distanceModel

    Returns the current distance model, the two options are PXSoundMixerDistanceModel_Linear or PXSoundMixerDistanceModel_Logarithmic. The default value is PXSoundMixerDistanceModel_Logarithmic.

  • + playAll

    Plays all sound channels.

  • + pauseAll

    Pauses all sound channels.

  • + stopAll

    Stops all sound channels.

  • + rewindAll

    Rewinds all sound channels.

Class Methods

distanceModel

Returns the current distance model, the two options are PXSoundMixerDistanceModel_Linear or PXSoundMixerDistanceModel_Logarithmic. The default value is PXSoundMixerDistanceModel_Logarithmic.

+ (PXSoundMixerDistanceModel)distanceModel

Return Value

The distance model.

Example:

PXSoundMixerDistanceModel distanceModel = [PXSoundMixer distanceModel];

Discussion

The distance model is how the volume of a sound changes depending on how far it is from the PXSoundListener.

Declared In

PXSoundMixer.m

pauseAll

Pauses all sound channels.

+ (void)pauseAll

Declared In

PXSoundMixer.m

playAll

Plays all sound channels.

+ (void)playAll

Declared In

PXSoundMixer.m

rewindAll

Rewinds all sound channels.

+ (void)rewindAll

Declared In

PXSoundMixer.m

setDistanceModel:

Sets the distance model for the sound. This means that the further the sound gets from the listener, how it the volume will change. The two options available are either PXSoundMixerDistanceModel_Linear or PXSoundMixerDistanceModel_Logarithmic.

+ (void)setDistanceModel:(PXSoundMixerDistanceModel)distanceModel

Parameters

distanceModel

The distance model.

Example:

[PXSoundMixer setDistanceModel:PXSoundMixerDistanceModel_Logarithmic];

See Also

Declared In

PXSoundMixer.m

setSoundTransform:

Changes the pitch and volume of every sound.

+ (void)setSoundTransform:(PXSoundTransform *)soundTransform

Parameters

soundTransform

The sound transform to set.

Example:

PXSoundTransform *soundTransform = [[PXSoundTransform alloc] initWithVolume:0.5f pitch:2.0f];
[PXSoundMixer setSoundTransform:soundTransform];
// All sounds will now be at 50% volume from what they were, meaning if a
// sound was at 30% volume, it is now at 15%, likewise the pitch is at 200%,
// meaning if the pitch of a sound was at 50%, it is now at 100%.
[soundTransform release];

Declared In

PXSoundMixer.m

setSpeedOfSound:

Sets the speed of sound, this is useful for the doppler effect.

+ (void)setSpeedOfSound:(float)speedOfSound

Parameters

speedOfSound

The speed of sound.

Example:

[PXSoundMixer setSpeedOfSound:64.0f];
// Sets the speed of sound to 64.0 points/second.

Declared In

PXSoundMixer.m

soundListener

Returns the global sound listener.

+ (PXSoundListener *)soundListener

Return Value

The global sound listener.

Example:

PXSoundListener *globalSoundListener = [PXSoundMixer soundListener];

Declared In

PXSoundMixer.m

soundTransform

Returns the global sound transform.

+ (PXSoundTransform *)soundTransform

Return Value

The global sound transform.

Example:

PXSoundTransform *globalSoundTransform = [PXSoundMixer soundTransform];
// globalSoundTransform by default will have 1.0f for volume, and 1.0f for
// pitch.

Declared In

PXSoundMixer.m

speedOfSound

Returns the speed of sound.

+ (float)speedOfSound

Return Value

The speed of sound.

Example:

float speedOfSound = [PXSoundMixer speedOfSound];

Default: 340.29f

Declared In

PXSoundMixer.m

stopAll

Stops all sound channels.

+ (void)stopAll

Declared In

PXSoundMixer.m

warmUp

Initializes the sound engine so that when you go to play a sound there is not the initial delay of setting up the engine. This is suggested to do at the start of your program if you are in need of playing sounds immediately within the duration of your app.

+ (void)warmUp

Declared In

PXSoundMixer.m