Changeset 117:b3b15c6ff97d in roaraudio
- Timestamp:
- 07/13/08 14:42:11 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roarclients/roarvorbis.c
r115 r117 28 28 29 29 int main (int argc, char * argv[]) { 30 int rate = 44100;31 30 int bits = 16; 32 int channels = 2;33 31 int codec = ROAR_CODEC_DEFAULT; 34 32 char * server = NULL; … … 67 65 } 68 66 69 if ( roar_stream_new(&s, rate, channels, bits, codec) == -1 ) {70 roar_disconnect(&con);71 return -1;72 }73 74 if ( roar_stream_connect(&con, &s, ROAR_DIR_PLAY) == -1 ) {75 roar_disconnect(&con);76 return -1;77 }78 79 67 if ( (in = fopen(file, "rb")) == NULL ) { 80 68 roar_disconnect(&con); … … 99 87 struct roar_meta meta; 100 88 89 fprintf(stderr, "Audio: %i channel, %liHz\n\n", vi->channels, vi->rate); 90 91 if ( roar_stream_new(&s, vi->rate, vi->channels, bits, codec) == -1 ) { 92 roar_disconnect(&con); 93 return -1; 94 } 95 96 if ( roar_stream_connect(&con, &s, ROAR_DIR_PLAY) == -1 ) { 97 roar_disconnect(&con); 98 return -1; 99 } 100 101 101 meta.value = value; 102 102 meta.key[0] = 0; … … 106 106 roar_stream_meta_set(&con, &s, ROAR_META_MODE_SET, &meta); 107 107 108 109 108 110 while(*ptr){ 109 fprintf(stderr,"%s\n",*ptr);110 111 111 for (j = 0; (*ptr)[j] != 0 && (*ptr)[j] != '='; j++) 112 112 key[j] = (*ptr)[j]; … … 121 121 roar_stream_meta_set(&con, &s, ROAR_META_MODE_SET, &meta); 122 122 123 fprintf(stderr, "Meta %-16s: %s\n", key, value); 123 124 ++ptr; 124 125 } 125 fprintf(stderr,"\nBitstream is %d channel, %ldHz\n",vi->channels,vi->rate); 126 fprintf(stderr,"Encoded by: %s\n\n",ov_comment(&vf,-1)->vendor); 126 127 127 } 128 128 … … 132 132 } 133 133 134 while (!eof){135 long ret =ov_read(&vf,pcmout,sizeof(pcmout),0,2,1,¤t_section);134 while (!eof) { 135 long ret = ov_read(&vf, pcmout, sizeof(pcmout), 0, 2, 1, ¤t_section); 136 136 if (ret == 0) { 137 137 /* EOF */
Note: See TracChangeset
for help on using the changeset viewer.