---
name: "roar_vs_sync"
section: "3"
platform: "linux"
package: "libroar-dev"
version: "1.0~beta12-4"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/roar_vs_sync"
---

# roar\_vs\_sync(3)

Sync VS object with server

## NAME

roar\_vs\_sync - Sync VS object with server

## SYNOPSIS

\#include \<roaraudio.h\>

int     roar\_vs\_sync (roar\_vs\_t \* vss, int wait, int \* error);

## DESCRIPTION

This function syncs the local data buffers with the server by flushing them. The parameter **wait** is used to tell the function if it should also wait for the flushed data to be played (sometimes called drain by other sound systems). This mode is not recommended expect at end of stream as it will result in buffer underruns.

This function does only flush IO buffers not the ring buffers in buffered mode. Use [**roar\_vs\_iterate**(3)](/roar_vs_iterate/3.md) or [**roar\_vs\_run**(3)](/roar_vs_run/3.md) to do this.

## PARAMETERS

- **vss**

  The VS object to be synced.

- **wait**

  Specifies if the calls should block until all data has been played. Must be ROAR\_VS\_WAIT or ROAR\_VS\_NOWAIT.

- **error**

  This is a pointer to a integer used to store the error value in case of error. This can be NULL if not used but it is very recommended to use this error value to report good error messages to the user.

## RETURN VALUE

On success these calls return 0.  On error, -1 is returned.

## NOTES

This function uses the WAIT protocol command if **wait** is set to ROAR\_VS\_WAIT. This is not supported by all servers.

## EXAMPLES

FIXME

## SEE ALSO

[**roarvs**(7)](/roarvs/7.md), [**libroar**(7)](/libroar/7.md), [**RoarAudio**(7)](/RoarAudio/7.md).
