---
name: "YDestroyPlaySoundObject"
section: "3"
platform: "linux"
package: "liby-dev"
version: "2.14.5-7"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/YDestroyPlaySoundObject"
---

# YDestroyPlaySoundObject(3)

sound object stopping

## NAME

YDestroyPlaySoundObject - sound object stopping

## SYNTAX

\#include \<Y2/Y.h\>\
 \#include \<Y2/Ylib.h\>

void YDestroyPlaySoundObject(\
\
         YConnection \**connection*,\
\
         YID *yid*\
 )

## ARGUMENTS

- *connection*

  Specifies the connection to the Y server, obtained by a call to YOpenConnection.

- *yid*

  Specifies the YID of the playing instance of the sound object that you want to stop. This value should have been returned by a prior call to YStartPlaySoundObject or YStartPlaySoundObjectSimple.

## DESCRIPTION

The YDestroyPlaySoundObject function stops the playing instance of a sound object referanced by the specified *yid*.

The *yid* should have been obtained by a prior call to YStartPlaySoundObject or YStartPlaySoundObjectSimple If *yid* is YIDNULL or no longer existant then no operation will be performed.

A YSoundObjectKill event will be sent to the Y client if a sound object currently being played was killed.

## EXAMPLE

\#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)](/return/1.md);

        yid = YStartPlaySoundObjectSimple(\
                 con, "/usr/share/sounds/info.wav"\
         );

        [sleep(3)](/sleep/3.md);

        YDestroyPlaySoundObject(con, yid);

        YCloseConnection(con, False);

        return(0);\
 }

## SEE ALSO

[YStartPlaySoundObject(3)](/YStartPlaySoundObject/3.md) [YStartPlaySoundObjectSimple(3)](/YStartPlaySoundObjectSimple/3.md) [YGetSoundObjectAttributes(3)](/YGetSoundObjectAttributes/3.md)
