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);
121 NULL, NULL, filter_graph);
152 outputs->
next = NULL;
160 &inputs, &outputs, NULL)) < 0)
168 outlink = buffersink_ctx->
inputs[0];
185 const uint16_t *p = (uint16_t*)frame->
data[0];
186 const uint16_t *p_end = p + n;
189 fputc(*p & 0xff, stdout);
190 fputc(*p>>8 & 0xff, stdout);
196 int main(
int argc,
char **argv)
204 if (!frame || !filt_frame) {
205 perror(
"Could not allocate frame");
209 fprintf(stderr,
"Usage: %s file | %s\n", argv[0],
player);
260 if (packet.
size <= 0)
275 fprintf(stderr,
"Error occurred: %s\n",
av_err2str(ret));