summaryrefslogtreecommitdiff
path: root/decoders/mpg123_decoder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'decoders/mpg123_decoder.cpp')
-rw-r--r--decoders/mpg123_decoder.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/decoders/mpg123_decoder.cpp b/decoders/mpg123_decoder.cpp
index ec6f490..13e9861 100644
--- a/decoders/mpg123_decoder.cpp
+++ b/decoders/mpg123_decoder.cpp
@@ -17,8 +17,15 @@ DecoderMpg123::DecoderMpg123(const std::string& filename) {
throw std::runtime_error(mpg123_plain_strerror(error));
}
+ long rate;
+ int channels, enc;
+ mpg123_getformat(handle, &rate, &channels, &enc);
+ std::cout << boost::format("mpg123: %li Hz, %i channels, encoding value %i") % rate % channels % enc << std::endl;
+ this->samplerate = rate;
+ this->channels = channels;
+
mpg123_format_none(handle);
- mpg123_format(handle, 44100, 2, MPG123_ENC_SIGNED_16);
+ mpg123_format(handle, rate, channels, MPG123_ENC_SIGNED_16);
}
DecoderMpg123::~DecoderMpg123() {