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