GSDP:GAM100/CProcessing/CP Sound PlayAdvanced()

From Inside
Jump to: navigation, search

CP_Sound_PlayAdvanced()

Description

Plays a given CP_Sound edited by the other given parameters

Parameters

CP_Sound_PlayAdvanced(CP_Sound sound, float volume, float pitch, CP_BOOL looping, CP_SOUND_GROUP group)

  • sound - (CP_Sound) The sound that you want to play.
  • volume - (float) The volume modifier that you want to apply (1.0f = no modification).
  • pitch - (float) The pitch modification that you want to apply (1.0f = no modification).
  • looping - (CP_BOOL) If you want the sound to loop or not.
  • group - (CP_SOUND_GROUP) The sound group that you want the sound played in

Example

CP_Sound mySound = NULL;

void init()
{
  mySound = CP_Sound_Load("./Assets/Justins_voice.wav");
}

void update()
{
  CP_Settings_Background(CP_Color_Create(255, 255, 255, 255));
 
    // play a sound with double the pitch (1 octave up), looping, and put it in sound group 2
  CP_Sound_PlayAdvanced(mySound, 1.0f, 2.0f, TRUE, CP_SOUND_GROUP_2);
}

void shutdown()
{
  CP_Sound_Free(mySound);
}

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>