Exemplo n.º 1
0
int main(int argc, char **args)
{
	if (argc < 3)
	{
		printf("Usage: %s wati_flag sound_file ...\n", args[0]);
		return 0;
	}

#ifndef __host
	if (gpio_init() < 0)
	{
		DBG_ERR("Init gpio fail!");
		return 1;
	}
	if (open_sound_card()) return 1;
#endif

	int handle;
	if (start_sound_thread(SOUND_DEV, MIXER_DEV, &handle))
	{
		return 1;
	}

	int wflag = atoi(args[1]);

	int i, j = 1; 
	for(;;)
		for (i = 2; i < argc; i++)
		{
			printf("Play  %s @ Count: %d\n", args[i], j++);
			call_play_sound(handle, args[i], wflag, wflag, 0);
		}

	sleep(10);
	return 0;
}
Exemplo n.º 2
0
      exit (1);
    }
  server = argv[1];
  port = atoi (argv[2]);
  mountpoint = argv[3];
  password = argv[4];
  name = argv[5];
  genre = argv[6];
  url = argv[7];
  description = argv[8];
  public = atoi (argv[9]);	/* ignore this */
  samplerate = atoi (argv[10]);
  channels = atoi (argv[11]);
  bitrate = atoi (argv[12]) / 1000;

  audio_fd = open_sound_card ("/dev/dsp", 44100, 2);
  socket_fd =
    open_connection_to_server (server, port, mountpoint, password,
			       bitrate, name, genre, url, description, public, sp);	/* rip out .wav header *//* fread(readbuffer,1,44,stdin); */

/********** Encode setup ************/

/* choose an encoding mode *//* (mode 0: 44kHz stereo uncoupled, roughly 128kbps VBR) */
  vorbis_info_init (&vi);
  vorbis_encode_init (&vi, 2, 44100, -1, 128000, -1);

/* add a comment */
vorbis_comment_init (&vc);
vorbis_comment_add (&vc, "ARTIST=.oO( Radio FG )Oo.");
vorbis_comment_add (&vc, "TITLE=live techno radio from France");
vorbis_comment_add (&vc, "DATE=2001-08-22");