- Specifies the connection to the Y server, obtained by a call to YOpenConnection.
- Returns the length of the sound buffer in bytes.
- Returns the shared memory id of the sound buffer.
The YSHMOpenSound obtains a direct pointer to the sound buffer on the Y server. The returned buffer must be deallocated with a call to YSHMCloseSound.
If you receive a YSHMSound event with the minor_op_code set to YSHMSoundClose then the pointer to the sound buffer obtained from YSHMOpenSound is no longer referenced by the Y server and is now useless. You need to reopen the buffer by calling YSHMCloseSound and then YSHMOpenSound to reobtain the direct pointer to the sound buffer on the Y server.
The process of the client and the server must both be running on the same physical machine.
The YSHMSoundOpen returns a direct pointer to the sound buffer on the Y server or NULL on error.
int main(int argc, char *argv)
int length, id;
YConnection *con = YOpenConnection(
if(con == NULL)
/* Obtain the pointer to the sound buffer. */
buf = YSHMOpenSound(con, &length, &id);
if(buf != NULL)
/* Do something with the buffer here. */
/* Close the pointer to the sound buffer. */