00:47
I need to write function in C that changes sample rate of one audio channel (float linear array).
I have this now:
int resample_audio(float *audio_input, int input_sample_rate, int output_sample_rate, int input_num_of_samples, float *audio_output, int *result_num_of_samples)
SwrContext* swr_ctx = swr_alloc();
if (!swr_ctx)
fprintf(stderr, "Could not allocate SwrContext\\n");
return -1;
av_opt_set_int(swr_ctx, "in_channel_layout", AV_CH_LAYOUT_MONO, 0);
av_opt_set_int(swr_ctx, "out_channel_layout", AV_CH_LAYOUT_MONO, 0);
(...)