41 static const char *
filter_descr =
"aresample=8000,aformat=sample_fmts=s16:channel_layouts=mono";
42 static const char *
player =
"ffplay -f s16le -ar 8000 -ac 1 -";
95 static const int out_sample_rates[] = { 8000, -1 };
100 if (!outputs || !inputs || !filter_graph) {
109 "time_base=%d/%d:sample_rate=%d:sample_fmt=%s:channel_layout=0x%"PRIx64,
113 args,
NULL, filter_graph);
176 &inputs, &outputs,
NULL)) < 0)
184 outlink = buffersink_ctx->
inputs[0];
201 const uint16_t *p = (uint16_t*)frame->
data[0];
202 const uint16_t *p_end = p + n;
205 fputc(*p & 0xff, stdout);
206 fputc(*p>>8 & 0xff, stdout);
212 int main(
int argc,
char **argv)
220 if (!frame || !filt_frame) {
221 perror(
"Could not allocate frame");
225 fprintf(stderr,
"Usage: %s file | %s\n", argv[0],
player);
276 if (packet.
size <= 0)
291 fprintf(stderr,
"Error occurred: %s\n",
av_err2str(ret));