YStartPlaySoundObjectSimple - sound object playing
#include <Y2/Y.h>
#include <Y2/Ylib.h>
YID YStartPlaySoundObjectSimple(
YConnection *connection,
const char *path
)
The YStartPlaySoundObject function begins playing a sound object specified by path using default values.
On success a YSoundObjectPlay event will be generated.
If you wish to start playing a sound object with specified values, then use YStartPlaySoundObject instead.
The YStartPlaySoundObjectSimple function returns the YID of the sound object being played or YIDNULL on failure. The returned YID represents the playing instance of the sound object (not the sound object's file data).
At any time YDestroyPlaySoundObject can be called to stop the play of the sound object.
When this sound object stops playing (either when it reaches the end of its life cycle or interrupted by the Y client) a YSoundObjectKill event will be sent to the Y client.
#include <stdio.h>
#include <unistd.h>
#include <Y2/Y.h>
#include <Y2/Ylib.h>
int main(int argc, char *argv[])
{
YID yid;
YConnection *con = YOpenConnection(
"/usr/sbin/starty",
"127.0.0.1:9433"
);
if(con == NULL)
return(1);
yid = YStartPlaySoundObjectSimple(
con, "/usr/share/sounds/info.wav"
);
sleep(3);
YDestroyPlaySoundObject(con, yid);
YCloseConnection(con, False);
YStartPlaySoundObject(3) YSetPlaySoundObjectValues(3) YGetSoundObjectAttributes(3) YDestroyPlaySoundObject(3)