ref: 275b9fd61b90f961806ba3816b0442662658eb7f
dir: /opus-tools-defaults/
--- /mnt/git/object/9e6bc60eca7b34de0173ae12a5de7d6699bffe86/tree/src/audio-in.c +++ src/audio-in.c @@ -668,8 +668,8 @@ this length so that we do not misinterpret any additional chunks after this as audio. Also use this length to report percent progress. */ - wav->totalsamples = opt->total_samples_per_channel = - len/(format.channels*samplesize); + wav->totalsamples = len/(format.channels*samplesize); + opt->total_samples_per_channel = wav->totalsamples; } else { --- /mnt/git/object/9e6bc60eca7b34de0173ae12a5de7d6699bffe86/tree/src/opusdec.c +++ src/opusdec.c @@ -436,27 +436,13 @@ defined HAVE_SYS_AUDIOIO_H || defined WIN32 || defined _WIN32 printf("Usage: opusdec [options] input [output]\n"); #else - printf("Usage: opusdec [options] input output\n"); + printf("Usage: opusdec [options]\n"); #endif - printf("\n"); - printf("Decode audio in Opus format to Wave or raw PCM\n"); - printf("\n"); - printf("input can be:\n"); - printf(" file:filename.opus Opus URL\n"); - printf(" filename.opus Opus file\n"); - printf(" - stdin\n"); - printf("\n"); - printf("output can be:\n"); - printf(" filename.wav Wave file\n"); - printf(" filename.* Raw PCM file (any extension other than .wav)\n"); - printf(" - stdout (raw; unless --force-wav)\n"); #if defined HAVE_LIBSNDIO || defined HAVE_SYS_SOUNDCARD_H || \ defined HAVE_MACHINE_SOUNDCARD_H || defined HAVE_SOUNDCARD_H || \ defined HAVE_SYS_AUDIOIO_H || defined WIN32 || defined _WIN32 printf(" (default) Play audio\n"); #endif - printf("\n"); - printf("Options:\n"); printf(" -h, --help Show this help\n"); printf(" -V, --version Show version information\n"); printf(" --quiet Suppress program output\n"); @@ -468,7 +454,6 @@ printf(" --force-wav Force Wave header on output\n"); printf(" --packet-loss n Simulate n %% random packet loss\n"); printf(" --save-range file Save check values for every frame to a file\n"); - printf("\n"); } void version(void) @@ -683,7 +668,7 @@ int file_output; int old_li=-1; int li; - int quiet = 0; + int quiet = 1; int forcewav = 0; ogg_int64_t nb_read_total=0; ogg_int64_t link_read=0; @@ -709,10 +694,10 @@ float loss_percent=-1; float manual_gain=0; int force_rate=0; - int force_stereo=0; + int force_stereo=1; int requested_channels=-1; int channels=-1; - int rate=0; + int rate=44100; int wav_format=0; int dither=1; int fp=0; @@ -801,13 +786,7 @@ goto done; } } - if (argc_utf8-optind!=2 && argc_utf8-optind!=1) - { - usage(); - exit_code=1; - goto done; - } - inFile=argv_utf8[optind]; + inFile="-"; /*Output to a file or playback?*/ file_output=argc_utf8-optind==2; @@ -824,7 +803,7 @@ } wav_format|=forcewav; } else { - outFile=NULL; + outFile="-"; wav_format=0; /*If playing to audio out, default the rate to 48000 instead of the original rate. The original rate is --- /mnt/git/object/9e6bc60eca7b34de0173ae12a5de7d6699bffe86/tree/src/opusenc.c +++ src/opusenc.c @@ -117,20 +117,12 @@ static void usage(void) { - printf("Usage: opusenc [options] input_file output_file.opus\n"); - printf("\n"); - printf("Encode audio using Opus.\n"); + printf("Usage: opusenc [options]\n"); #if defined(HAVE_LIBFLAC) printf("The input format can be Wave, AIFF, FLAC, Ogg/FLAC, or raw PCM.\n"); #else printf("The input format can be Wave, AIFF, or raw PCM.\n"); #endif - printf("\ninput_file can be:\n"); - printf(" filename.wav file\n"); - printf(" - stdin\n"); - printf("\noutput_file can be:\n"); - printf(" filename.opus compressed file\n"); - printf(" - stdout\n"); printf("\nGeneral options:\n"); printf(" -h, --help Show this help\n"); printf(" -V, --version Show version information\n"); @@ -419,7 +411,7 @@ time_t last_spin=0; int last_spin_len=0; /*Settings*/ - int quiet=0; + int quiet=1; opus_int32 bitrate=-1; opus_int32 rate=48000; opus_int32 frame_size=960; @@ -460,12 +452,12 @@ range_file=NULL; in_format=NULL; inopt.channels=chan; - inopt.rate=rate; + inopt.rate=44100; /* 0 dB gain is recommended unless you know what you're doing */ inopt.gain=0; inopt.samplesize=16; inopt.endianness=0; - inopt.rawmode=0; + inopt.rawmode=1; inopt.rawmode_f=0; inopt.ignorelength=0; inopt.copy_comments=1; @@ -805,12 +797,8 @@ fatal("Invalid bit-depth:\n" "--raw-bits must be 32 for float sample format\n"); } - if (argc_utf8-optind!=2) { - usage(); - exit(1); - } - inFile=argv_utf8[optind]; - outFile=argv_utf8[optind+1]; + inFile="-"; + outFile="-"; if (cline_size > 0) { ret = ope_comments_add(inopt.comments, "ENCODER_OPTIONS", ENCODER_string);