X-Git-Url: https://git.sesse.net/?p=c64tapwav;a=blobdiff_plain;f=audioreader.cpp;h=f0d07d8c08741acde3d13197f50503128a5bcdc9;hp=b95dbf410c07df6b7786673df0c4875d13744d11;hb=d693db9567105ab7837addb952c2553d2dfa9543;hpb=bd548bb6f007d0b106a241480676bbc18196bdc8 diff --git a/audioreader.cpp b/audioreader.cpp index b95dbf4..f0d07d8 100644 --- a/audioreader.cpp +++ b/audioreader.cpp @@ -88,7 +88,7 @@ int decode_packet(const char *filename, AVCodecContext *codec_ctx, SwrContext *s } // namespace -bool read_audio_file(const char *filename, std::vector *samples) +bool read_audio_file(const char *filename, std::vector *samples, int *sample_rate) { av_register_all(); @@ -190,5 +190,7 @@ bool read_audio_file(const char *filename, std::vector *samples) // Convert any leftover samples from the converter. convert_samples(swr, codec_ctx->sample_rate, nullptr, 0, samples); + *sample_rate = codec_ctx->sample_rate; + return true; }