[icecast-dev] programming with libshout

Renito 73 renito73 at hotmail.com
Thu Feb 26 19:13:40 PST 2004



Hello... I have a doubt with the use of shout_send()... at low level, what 
should it send? the example reads from "stdin" and sends the read buffer 
with shout_send, but... where should fread() read from (behind the stdin)? I 
could think about something like this (for example)

mpg123 "audio_file" ---> stdout --pipe-- stdin <--- libshout_application

I include the little part of the example code I don't understand how it 
works, specifically fromwhere it gets the data... what should be received on 
STDIN?

and... in the case of record from the microphone, should I rec to stdout, 
redirect it to the stdin of LAME (or another encoder) and redirect again to 
stdout, so my application reads it from stdin (by using a pipe) and sends is 
with send_shout()?

if (shout_open(shout) == SHOUTERR_SUCCESS) {
   printf("Connected to server...\n");
   total = 0;
   while (1) {
      /*
       * MY DOUBT IS HERE IN THE FREAD
       */
      read = fread(buff, 1, sizeof(buff), stdin);
      total = total + read;

      if (read > 0) {
      ret = shout_send(shout, buff, read);
         if (ret != SHOUTERR_SUCCESS) {
            printf("DEBUG: Send error: %s\n", shout_get_error(shout));
            break;
         }
      } else {
         break;
      }

      shout_sync(shout);
   }

} else {
   printf("Error connecting: %s\n", shout_get_error(shout));
}

Thanks for your comments

_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus

--- >8 ----
List archives:  http://www.xiph.org/archives/
icecast project homepage: http://www.icecast.org/
To unsubscribe from this list, send a message to 'icecast-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Icecast-dev mailing list