source: roaraudio/doc/man3/roar_vs_stream.3 @ 5058:45211d6eeea9

Last change on this file since 5058:45211d6eeea9 was 5058:45211d6eeea9, checked in by phi, 13 years ago

Added manpages for all VS functions (Closing: #4)

File size: 2.2 KB
Line 
1.TH "roar_vs_stream" "3" "June 2011" "RoarAudio" "RoarAudio Programmer's Manual"
2
3.SH NAME
4roar_vs_stream \- Set up stream parameters for VS object
5
6.SH SYNOPSIS
7
8#include <roaraudio.h>
9
10int roar_vs_stream(roar_vs_t * vss, const struct roar_audio_info * info, int dir, int * error);
11
12.SH "DESCRIPTION"
13This function asks a VS object opened by \fBroar_vs_new_from_con\fR(3) or \fBroar_vs_new\fR(3)
14to open the data connection using the audio parameters \fBinfo\fR and the stream direction \fBdir\fR.
15
16This function needs to be called before data is read or written if one of the above functions is used
17to create the VS object.
18
19This function is also used to provide parameters for the file mode
20(which is started by using \fBroar_vs_file\fR(3) or \fBroar_vs_file_simple\fR(3)).
21To play back a file this is not needed in a common case as the VS API tries to find correct parameters.
22It is required for all other stream directions. See \fBroar_vs_file\fR(3) and \fBroar_vs_file_simple\fR(3)
23for more information.
24
25On failture this function can be called again with diffrent parameters.
26
27.SH "PARAMETERS"
28.TP
29\fBvss\fR
30The VS object to be updated.
31
32.TP
33\fBinfo\fR
34This is a pointer to the roar_audio_info structure storing the audio format parameters.
35The structure contains the following memebers:
36rate (sample rate), bits (bits per sample), channels (channels per frame) and codec.
37
38.TP
39\fBdir\fR
40This is the stream direction. Common values include ROAR_DIR_PLAY for waveform playback,
41ROAR_DIR_MONITOR for waveform monitoring, ROAR_DIR_RECORD for waveform recording.
42For MIDI ROAR_DIR_MIDI_IN and ROAR_DIR_MIDI_OUT is used.
43
44.TP
45\fBerror\fR
46This is a pointer to a integer used to store the error value in case of error.
47This can be NULL if not used but it is very recommended to use this error value to report
48good error messages to the user.
49
50.SH "RETURN VALUE"
51On success these calls return 0.  On error, \-1 is returned.
52
53.SH "EXAMPLES"
54 struct roar_audio_info info;
55 int err;
56
57 if ( roar_profile2info(&info, "isdn-eu") == -1 ) {
58  // error handling.
59 }
60
61 if ( roar_vs_stream(vss, &info, ROAR_DIR_PLAY, &err) == -1 ) {
62  // error handling.
63 }
64
65.SH "SEE ALSO"
66\fBroar_vs_file\fR(3),
67\fBroar_vs_file_simple\fR(3),
68\fBroarvs\fR(7),
69\fBlibroar\fR(7),
70\fBRoarAudio\fR(7).
71
72.\" ll
Note: See TracBrowser for help on using the repository browser.