Changeset 4013:abd38c189de7 in roaraudio for doc/man7/roartut.7
- Timestamp:
- 07/01/10 19:18:30 (14 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/man7/roartut.7
r4012 r4013 44 44 45 45 To open the connection we use the call \fBroar_simple_play\fR(3): 46 if ( (fh = roar_simple_play(rate, channels, bits, codec, NULL, "sine gen")) == -1 ) {46 if ( (fh = roar_simple_play(rate, channels, bits, codec, NULL, "sine gen")) == \-1 ) { 47 47 fprintf(stderr, "Error: can not open playback!\\n"); 48 48 exit(1); … … 59 59 } 60 60 61 The sine is multiplyed by 127 as our amplitude range for 8 bit signed int is from -128 to +127.61 The sine is multiplyed by 127 as our amplitude range for 8 bit signed int is from \-128 to +127. 62 62 63 63 After we have our current data in \fBout\fR we want to write them to the server: … … 89 89 char out[1024]; 90 90 91 if ( (fh = roar_simple_play(rate, channels, bits, codec, NULL, "sine gen")) == -1 ) {91 if ( (fh = roar_simple_play(rate, channels, bits, codec, NULL, "sine gen")) == \-1 ) { 92 92 fprintf(stderr, "Error: can not open playback!\\n"); 93 93 exit(1); … … 108 108 109 109 To compile and link we can use a command like this one: 110 cc -o roarsin roarsin.c -lm `roar-config --libs --cflags`110 cc \-o roarsin roarsin.c \-lm `roar\-config \-\-libs \-\-cflags` 111 111 112 112 We need to use \fB-lm\fR to link the math library for \fBsin()\fR.
Note: See TracChangeset
for help on using the changeset viewer.