GSDP:GAM100/CProcessing/CP Sound ResumeGroup()
From Inside
< GSDP:GAM100 | CProcessing
CP_Sound_ResumeGroup()
Description
Resumes all CP_Sounds that are currently paused within the given CP_SOUND_GROUP.
Prototype
void CP_Sound_PauseGroup(CP_SOUND_GROUP group)
Parameters
- group - (CP_SOUND_GROUP) The sound group that you want to resume playing
Return
This function does not return anything
Example
CP_Sound mySound = NULL;
CP_Sound mySecondSound = NULL;
void init()
{
mySound = CP_Sound_Load("./Assets/Justins_voice.wav");
mySecondSound = CP_Sound_Load("./Assets/Justins_laugh.wav");
}
void update()
{
float songLength = 500;
static float timer = 0;
timer += 1;
CP_Settings_Background(CP_Color_Create(255, 255, 255, 255));
CP_Sound_PlayAdvanced(mySound, 1, 1, TRUE, CP_SOUND_GROUP_3);
CP_Sound_PlayAdvanced(mySecondSound, 1, 1, TRUE, CP_SOUND_GROUP_5);
if(timer >= .5f * songLength)
{
// this will pause mySound, but not mySecondSound, because mySecondSound is not in CP_SOUND_GROUP_3
CP_Sound_PauseGroup(CP_SOUND_GROUP_3);
}
if(timer >= songLength)
{
CP_Sound_ResumeGroup(CP_SOUND_GROUP_3); // resume playing all sounds in group 3, currently only mySound
timer = 0; // reset timer so that group 3 pauses another 50% into the timer
}
}
void shutdown()
{
CP_Sound_Free(mySound);
CP_Sound_Free(mySecondSound);
}
Related
- Main Page
- CP_Sound
- CP_Sound_Load()
- CP_Sound_LoadMusic()
- CP_Sound_Play()
- CP_Sound_PlayMusic()
- CP_Sound_PlayAdvanced()
- CP_Sound_Free()
- CP_Sound_PauseAll()
- CP_Sound_PauseGroup()
- CP_Sound_ResumeAll()
- CP_Sound_ResumeGroup()
- CP_Sound_StopAll()
- CP_Sound_StopGroup()
- CP_Sound_SetGroupVolume()
- CP_Sound_GetGroupVolume()
- CP_Sound_SetGroupPitch()
- CP_Sound_GetGroupPitch()