The result can be piped into something like
play -b16 -c2 -esigned-integer -r44100 -L -traw -
to verify that its output approximates decoded audio.
disorder-gstdecode \- DisOrder audio decoder using GStreamer
.SH SYNOPSIS
.B disorder\-gstdecode
disorder-gstdecode \- DisOrder audio decoder using GStreamer
.SH SYNOPSIS
.B disorder\-gstdecode
.RB [ -c
.IR CONFIGFILE ]
.RB [ \-d
.RB [ -c
.IR CONFIGFILE ]
.RB [ \-d
(so that the volume level sounds consistent
when playing an entire album).
The default is \fBalbum\fR.
(so that the volume level sounds consistent
when playing an entire album).
The default is \fBalbum\fR.
+.TP
+.B \-\-stream\fR, \fB\-s
+Write a stream of raw samples to the output,
+instead of including DisOrder's usual framing.
+This is useful for testing the program on its own.
.SH "SEE ALSO"
.BR disorderd (8),
.BR disorder_config (5)
.SH "SEE ALSO"
.BR disorderd (8),
.BR disorder_config (5)
static GstAppSink *appsink;
static GstElement *pipeline;
static GMainLoop *loop;
static GstAppSink *appsink;
static GstElement *pipeline;
static GMainLoop *loop;
+static unsigned flags = 0;
+#define f_stream 1u
#define MODES(_) _("off", OFF) _("track", TRACK) _("album", ALBUM)
enum {
#define MODES(_) _("off", OFF) _("track", TRACK) _("album", ALBUM)
enum {
/* Write out a frame of audio data. */
hdr.nbytes = GST_BUFFER_SIZE(buf);
/* Write out a frame of audio data. */
hdr.nbytes = GST_BUFFER_SIZE(buf);
- if(fwrite(&hdr, sizeof(hdr), 1, fp) != 1 ||
+ if((!(flags&f_stream) && fwrite(&hdr, sizeof(hdr), 1, fp) != 1) ||
fwrite(GST_BUFFER_DATA(buf), 1, hdr.nbytes, fp) != hdr.nbytes)
disorder_fatal(errno, "output");
fwrite(GST_BUFFER_DATA(buf), 1, hdr.nbytes, fp) != hdr.nbytes)
disorder_fatal(errno, "output");
{ "noise-shape", required_argument, 0, 'n' },
{ "quality", required_argument, 0, 'q' },
{ "replay-gain", required_argument, 0, 'r' },
{ "noise-shape", required_argument, 0, 'n' },
{ "quality", required_argument, 0, 'q' },
{ "replay-gain", required_argument, 0, 'r' },
+ { "stream", no_argument, 0, 's' },
" `simple', `medium' or `high'\n"
" --quality QUAL, -q QUAL Resampling quality: 0 poor, 10 good\n"
" --replay-gain MODE, -r MODE MODE is `off', `track' or `album'\n"
" `simple', `medium' or `high'\n"
" --quality QUAL, -q QUAL Resampling quality: 0 poor, 10 good\n"
" --replay-gain MODE, -r MODE MODE is `off', `track' or `album'\n"
+ " --stream, -s Output raw samples, without framing\n"
"\n"
"Alternative audio decoder for DisOrder. Only intended to be\n"
"used by speaker process, not for normal users.\n");
"\n"
"Alternative audio decoder for DisOrder. Only intended to be\n"
"used by speaker process, not for normal users.\n");
if(!setlocale(LC_CTYPE, "")) disorder_fatal(errno, "calling setlocale");
/* Parse command line. */
if(!setlocale(LC_CTYPE, "")) disorder_fatal(errno, "calling setlocale");
/* Parse command line. */
- while((n = getopt_long(argc, argv, "hVc:d:f:n:q:r:", options, 0)) >= 0) {
+ while((n = getopt_long(argc, argv, "hVc:d:f:n:q:r:s", options, 0)) >= 0) {
switch(n) {
case 'h': help();
case 'V': version("disorder-gstdecode");
switch(n) {
case 'h': help();
case 'V': version("disorder-gstdecode");
case 'n': shape = getenum("noise-shaping type", optarg, shapes); break;
case 'q': quality = getint("resample quality", optarg, 0, 10); break;
case 'r': mode = getenum("ReplayGain mode", optarg, modes); break;
case 'n': shape = getenum("noise-shaping type", optarg, shapes); break;
case 'q': quality = getint("resample quality", optarg, 0, 10); break;
case 'r': mode = getenum("ReplayGain mode", optarg, modes); break;
+ case 's': flags |= f_stream; break;
default: disorder_fatal(0, "invalid option");
}
}
default: disorder_fatal(0, "invalid option");
}
}