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

# YSetPlaySoundObjectValues(3)

set playing sound object values

## NAME

YSetPlaySoundObjectValues - set playing sound object values

## SYNTAX

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

void YSetPlaySoundObjectValues(\
\
         YConnection \**connection*,\
\
         YID *yid*,\
\
         YEventSoundPlay \**value*\
 )

## 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 previously returned by a call to YStartPlaySoundObject or YStartPlaySoundObjectSimple.

- *value*

  Specifies the values to change on the playing sound object. See YEventSoundPlay for more information about this structure.

## DESCRIPTION

The YSetPlaySoundObjectValues changes the play values of a sound object already playing. The value of yid must be that of one received from a call to YStartPlaySoundObject or YStartPlaySoundObjectSimple.

On success a YSoundObjectPlayValues event will be generated.

## EXAMPLE

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

int main(int argc, char \*argv\[\])\
 {\
\
         YID yid;\
\
         YEventSoundPlay value;\
\
         YConnection \*con = YOpenConnection(\
\
                 "/usr/sbin/starty",\
\
                 "127.0.0.1:9433"\
\
         );\
\
         if(con == NULL)\
\
                 [return(1)](/return/1.md);

        /\* Start playing a sound object. \*/\
\
         yid = YStartPlaySoundObjectSimple(\
                 con, "/usr/share/sounds/info.wav"\
         );

        /\* Set up values that we want to modify. \*/\
\
         value.flags = (YPlayValuesFlagYID \|\
\
                       YPlayValuesFlagSampleRate);\
\
         value.yid = yid; /\* Must set this. \*/\
\
         value.sample\_rate = 22050; /\* Speed up! \*/

        /\* Modify the playing sound object. \*/\
\
         YSetPlaySoundObjectValues(\
\
                 con, yid, &value\
\
         );

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

        YDestroyPlaySoundObject(con, yid);

        YCloseConnection(con, False);

        return(0);\
 }

## SEE ALSO

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