0
該教程顯示這種方式,如何讓SDL播放FLTP樣本(AAC)?
SDL_AudioSpec wanted_spec, spec;
wanted_spec.freq = aCodecCtx->sample_rate;
wanted_spec.format = AUDIO_S16SYS;
wanted_spec.channels = aCodecCtx->channels;
wanted_spec.silence = 0;
wanted_spec.samples = SDL_AUDIO_BUFFER_SIZE;
wanted_spec.callback = audio_callback;
wanted_spec.userdata = aCodecCtx;
SDL_OpenAudio(&wanted_spec, &spec);
它不工作,顯然樣品浮動點和SDL音頻規範格式是16個樣本。如何使SDL適用於浮點樣本?
謝謝你,兄弟。 libswresample完成這項工作。 – imdadable