Exemplo n.º 1
0
static int auto_speex_output_open(const char *input_filename, const char *title)
{
  char *output_filename;

#if !defined ( IA_W32GUI ) && !defined ( IA_W32G_SYN )
  output_filename = create_auto_output_name(input_filename, "ogg", NULL, 0);
#else
  output_filename = create_auto_output_name(input_filename, "ogg", w32g_output_dir, w32g_auto_output_mode);
#endif
  if (output_filename == NULL){
    ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "unknown output file name");
    return -1;
  }
  if ((dpm.fd = speex_output_open(output_filename, input_filename)) == -1) {
    ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "files open failed %s->%s",
	      output_filename, input_filename);
    free(output_filename);
    return -1;
  }
  if (dpm.name != NULL)
    free(dpm.name);
  dpm.name = output_filename;

  ctl->cmsg(CMSG_INFO, VERB_NORMAL, "Output: %s", dpm.name);
  {
    char *st_string="mono";
    if (speex_ctx->channels == 2)
      st_string = "stereo";
    ctl->cmsg(CMSG_INFO, VERB_NORMAL, "Encoding %d Hz audio using %s mode (%s)",
	      speex_ctx->header.rate, speex_ctx->mode->modeName, st_string);
   }

  return 0;
}
Exemplo n.º 2
0
static int auto_flac_output_open(const char *input_filename, const char *title)
{
  char *output_filename;

  if (flac_options.isogg) {
#ifndef __W32G__
  output_filename = create_auto_output_name(input_filename, "ogg", NULL, 0);
#else
  output_filename = create_auto_output_name(input_filename, "ogg", w32g_output_dir, w32g_auto_output_mode);
#endif
  }
  else
  {
#ifndef __W32G__
    output_filename = create_auto_output_name(input_filename, "flac", NULL, 0);
#else
    output_filename = create_auto_output_name(input_filename, "flac", w32g_output_dir, w32g_auto_output_mode);
#endif
  }
  if (output_filename == NULL) {
    ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "unknown output file name");
	  return -1;
  }
  if ((flac_output_open(output_filename, input_filename)) == -1) {
    ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "files open failed %s->%s", output_filename, input_filename);
    free(output_filename);
    return -1;
  }
  if (dpm.name != NULL)
    free(dpm.name);
  dpm.name = output_filename;
  ctl->cmsg(CMSG_INFO, VERB_NORMAL, "Output %s", dpm.name);
  return 0;
}
Exemplo n.º 3
0
static int auto_gogo_output_open(const char *input_filename)
{
  char *output_filename;

#ifndef IA_W32GUI
  output_filename = create_auto_output_name(input_filename,"mp3",NULL,0);
#else
  gogo_ConfigDialogInfoApply();
  switch(gogo_opts.optOUTPUT_FORMAT){
  case MC_OUTPUT_NORMAL:
    output_filename = create_auto_output_name(input_filename,"mp3",(char *)w32g_output_dir,w32g_auto_output_mode);
    break;
  case MC_OUTPUT_RIFF_WAVE:
    output_filename = create_auto_output_name(input_filename,"wav",(char *)w32g_output_dir,w32g_auto_output_mode);
    break;
  case MC_OUTPUT_RIFF_RMP:
    output_filename = create_auto_output_name(input_filename,"rmp",(char *)w32g_output_dir,w32g_auto_output_mode);
    break;
  default:
    output_filename = create_auto_output_name(input_filename,"mp3",(char *)w32g_output_dir,w32g_auto_output_mode);
    break;
  }
#endif
  if(output_filename==NULL){
	  return -1;
  }
  if((dpm.fd = gogo_output_open(output_filename)) == -1) {
    free(output_filename);
    return -1;
  }
  if(dpm.name != NULL){
    free(dpm.name);
    dpm.name = NULL;
  }
  dpm.name = output_filename;
  ctl->cmsg(CMSG_INFO, VERB_NORMAL, "Output %s", dpm.name);
  return 0;
}