---
name: "muroar_stream"
section: "3"
platform: "linux"
package: "libmuroar-dev"
version: "0.1.13-7"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/muroar_stream"
---

# muroar\_stream(3)

Create a stream connected to a RoarAudio sound server

## NAME

muroar\_stream - Create a stream connected to a RoarAudio sound server

## SYNOPSIS

\#include \<muroar.h\>

muroar\_t muroar\_stream (muroar\_t fh, int dir, int \* stream, int codec, int rate, int channels, int bits);

## DESCRIPTION

This function connects a stream to a sound server supporting the RoarAudio protocol. It takes a connected control connection created with [**roar\_connect**(3)](/roar_connect/3.md) and converts it into a connected stream. The socket can no longer be used as control connection.

## PARAMETERS

- **fh**

  The connected control connection.

- **dir**

  The stream direction for the new stream. For playback of a waveform stream (PCM data) this is MUROAR\_PLAY\_WAVE. For all possible values see the official muRoar manual.

- **stream**

  This is a pointer to an integer muRoar stores the stream ID in. If your application does not need to know the stream ID of the new stream this can be set to NULL.

- **codec**

  This is the codec to be used for the new stream. For signed PCM in host byte order use MUROAR\_CODEC\_PCM or MUROAR\_CODEC\_PCM\_S. For unsigned PCM use MUROAR\_CODEC\_PCM\_U. There are a lot other codecs defined. However using a codec not supported by the server will result an failure of this call. For all possible values see the official muRoar manual.

- **rate**

  This is the sample/frame rate the new stream will use. For streams this setting does not make any sense set this to zero.

- **channels**

  This is the number of channels for the new stream. For streams this setting does not make any sense set this to zero.

- **bits**

  This is the number of bits per sample to be used by the data. For streams this setting does not make any sense set this to zero.

## RETURN VALUE

On success this call return the new stream IO handle. This may be the same as the control connection or a new one and the control connection is closed. On error, MUROAR\_HANDLE\_INVALID is returned.

## BUGS

In failure where is no way to tell was was going wrong.

## HISTORY

This function first appeared in muRoar version 0.1beta0.

## SEE ALSO

[**muroar\_connect**(3)](/muroar_connect/3.md), [**muroar\_close**(3)](/muroar_close/3.md), [**RoarAudio**(7)](/RoarAudio/7.md).
