Now the integration of the libsyn123 resampler and handling of the
NtoM decoder are hopefully correct in the again-enlarged audio.c,
which became a hollow shell with the advent of libout123, and now
is strong again.
Settling decoder and output formats has historically been the most
confusing aspect of libmpg123 and I raise that with the integration
of post-decoder resampling and pitching in the decoder, in the
output device, or in said resampling between these two. Insanity!
The new resampler is the default for forcing output rates now. If
you wonder why, try this in the current mpg123 source tree with
your fresh build:
for resampler in ntom dirty fine
do
src/mpg123 -r 22040 --resample $resampler --pitch -0.72 \
src/tests/sweep.mp3
done
With a pure sine sweep like that (generated via out123), you
can appreciate
a) the quality differences between resamplers, and
b) how little those seem to matter when you just listen
to music.
Really, without a detailed comparison and some noisy pop/rock
music, it is surprisingly hard to tell how bad the drop-sample
resampling of the NtoM decoder really is.
But this has a price: Even when I took great pains in designing
the syn123 resampler, it needs more computing time than the
MPEG decoder itself. That's life. You can make resamplers that
are faster, but at the cost of increased latency which makes
programming tedious. Here, I just ignored that aspect, as the
syn123 resampling latency is just a handful of samples, well
below the farts you get from ALSA on closing a device.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4662 35dc7657-300d-0410-a2e5-dc2837fedb53
The quality of 2to1 and 4to1 decoding is good and it even saves work.
Win-win.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4651 35dc7657-300d-0410-a2e5-dc2837fedb53
This is about preventing unnecessary work where the downsampling in
libmpg123 (factor 2 or 4) can be used. The external resampler is
only called when we would have to resort to NtoM decoding.
A major change is that libmpg123 now considers floating point encoding
by itself, at all.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4649 35dc7657-300d-0410-a2e5-dc2837fedb53
This now forces the proper resampler with --rate and --resample with
non-zero value.
TODO:
- Avoid the resampler when unnecessary. This is some more complex
setup code, but doable. Loose filter history on re-enabling
the resampler.
- Finish integration with pitching.
Have a look at that:
for s in 0 1 2
do src/mpg123 -vv -r 48000 --resample $s -w sweep$s.wav src/tests/sweep.mp3
sox sweep$s.wav -n spectrogram
mv spectrogram.png sweep$s.png
done
Some graphs that drive the point home.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4644 35dc7657-300d-0410-a2e5-dc2837fedb53
This only affects one output module that wasn't built since a long time,
I guess.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4641 35dc7657-300d-0410-a2e5-dc2837fedb53
This adds some bits for supporting the syn123 resampler, but not putting
it to work yet.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4640 35dc7657-300d-0410-a2e5-dc2837fedb53
This now filters strings from libmpg123 metadata and the user/web input for useless/nasty
control/non-printable characters when the output is a terminal. It covers all relevant
printouts except the ones I forgot. Metadata, user-provided command-line arguments and
file names in the playlist are covered. I guess really relevant is the data that the
user did not enter explicitly (metadata in streams, playlist from URL).
The proper way would be to fully use locales and a curses library to sanitize terminal
output, but I really would like to avoid that mess, having my personal mess as a compromise
that should mostly work OK. Future may correct me. When we want to do it properly, we should
re-write the whole mpg123 application from scratch, using the mpg123 libraries for audio and
other libraries for the interface.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4636 35dc7657-300d-0410-a2e5-dc2837fedb53
This early free() of the buffer in safe_exit() occured while the output
may still be during execution of out123_play() to use that buffer. Now
it's after output stopped.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4635 35dc7657-300d-0410-a2e5-dc2837fedb53
This catches whitespace characters like line breaks and turns sequences
of those into a single normal space character before filtering for
nasties in terminal output. So
Some
Strange
Title
turns into Some Strange Title for print, not SomeStrangeTitle.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4633 35dc7657-300d-0410-a2e5-dc2837fedb53
This introduces a check to only filter the non-printing characters
when actually printing to a terminal. The print_outstr() function
shall be used in future.
The test mp3 file got a line break introduced in the album name.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4631 35dc7657-300d-0410-a2e5-dc2837fedb53
This takes the code out if id3_gap() to be able to make UTF-8 from any encoding
that mpg123 encounters elsewhere (assuming everything is ASCII-based there).
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4630 35dc7657-300d-0410-a2e5-dc2837fedb53
This makes --STDOUT for out123 more official and robust using
newly introduced unintr_fwrite(). The other unintr functions got
fixes for actual interrupts that result in negative return vaues.
For mpg123, --STDOUT has been removed. It was an alias to --stdout
anyway, and it it actually not that easy to get right with the
live playback semantics.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4626 35dc7657-300d-0410-a2e5-dc2837fedb53