SVC PLAY SOUND

From LIVECHAT Developer Zone Wiki

Jump to: navigation, search
SVC_PLAY_SOUND
Play event sound.


Parameters
wParam
NULL
lParam
SoundInfo* info


Return values

  • Returns API_ERROR if operation failed otherwise API_SUCCESS.


Remarks
To obtain information about predefined sound names, see SoundInfo.


Sample code
Playing predefined sound in loop:

        SoundInfo info = {0};
	info.cbSize = sizeof(SoundInfo);
	info.use_path = false;
	info.sync = false;
	info.sound_name = _T("Sound_IncomingCall");
	info.loop = true;

	call(SVC_PLAY_SOUND, (WPARAM)0, (LPARAM)&info);   //start playing

	sleep(10000);

	info.sound_name = NULL;
	call(SVC_PLAY_SOUND, (WPARAM)0, (LPARAM)&info);   //stop playing

Playing sound from the path.

        SoundInfo info = {0};
	info.cbSize = sizeof(SoundInfo);
	info.use_path = true;
	info.sync = false;
	info.sound_name = _T("C:\sample_sound.wav");
	info.loop = false;

	call(SVC_PLAY_SOUND, (WPARAM)0, (LPARAM)&info);   //play once
Personal tools