• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt/router/flac/examples/c/encode/file/

Lines Matching defs:encoder

1 /* example_c_encode_file - Simple FLAC file encoder using libFLAC
37 static void progress_callback(const FLAC__StreamEncoder *encoder, FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate, void *client_data);
48 FLAC__StreamEncoder *encoder = 0;
83 /* allocate the encoder */
84 if((encoder = FLAC__stream_encoder_new()) == NULL) {
85 fprintf(stderr, "ERROR: allocating encoder\n");
90 ok &= FLAC__stream_encoder_set_verify(encoder, true);
91 ok &= FLAC__stream_encoder_set_compression_level(encoder, 5);
92 ok &= FLAC__stream_encoder_set_channels(encoder, channels);
93 ok &= FLAC__stream_encoder_set_bits_per_sample(encoder, bps);
94 ok &= FLAC__stream_encoder_set_sample_rate(encoder, sample_rate);
95 ok &= FLAC__stream_encoder_set_total_samples_estimate(encoder, total_samples);
114 ok = FLAC__stream_encoder_set_metadata(encoder, metadata, 2);
117 /* initialize encoder */
119 init_status = FLAC__stream_encoder_init_file(encoder, argv[2], progress_callback, /*client_data=*/NULL);
121 fprintf(stderr, "ERROR: initializing encoder: %s\n", FLAC__StreamEncoderInitStatusString[init_status]);
126 /* read blocks of samples from WAVE file and feed to encoder */
142 /* feed samples to encoder */
143 ok = FLAC__stream_encoder_process_interleaved(encoder, pcm, need);
149 ok &= FLAC__stream_encoder_finish(encoder);
152 fprintf(stderr, " state: %s\n", FLAC__StreamEncoderStateString[FLAC__stream_encoder_get_state(encoder)]);
158 FLAC__stream_encoder_delete(encoder);
164 void progress_callback(const FLAC__StreamEncoder *encoder, FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate, void *client_data)
166 (void)encoder, (void)client_data;