Giter Club home page Giter Club logo

twolame's Introduction

TwoLAME

Build Status

Based on tooLAME by Michael Cheng

All changes to the ISO source are licensed under the LGPL (see COPYING for details)

TwoLAME is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

TwoLAME is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with TwoLAME; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

INTRODUCTION

TwoLAME is an optimized MPEG Audio Layer 2 (MP2) encoder. It is based heavily on:

  • tooLAME by Michael Cheng
  • the ISO dist10 code
  • improvement to algorithms as part of the LAME project (lame.sf.net)
  • other contributors (see AUTHORS)

TwoLAME should be able to be used as a drop-in replacement for LAME (a MPEG Layer 3 encoder). The frontend takes very similar command line options to LAME, and the backend library has a very similar API to LAME.

For the latest version of TwoLAME, visit the project homepage: http://www.twolame.org/

MPEG Audio Layer 2 (MP2)

(taken from Wikipedia article on MP2)

MP2 (sometimes incorrectly named Musicam) is a short form of MPEG Audio Layer II, and it is also used as a file extension for files containing audio data of this type. While it has largely been superseded by MP3 for PC and Internet applications, it remains a dominant standard for audio broadcasting as part of the DAB digital radio and DVB digital television standards. It is also used internally within the radio industry, for example in NPR's PRSS Content Depot programming distribution system.

INSTALLATION

Standard automake process:

./configure
make
make install

REFERENCE PAPERS

(Specifically Layer II Papers)

Kumar, M & Zubair, M., A high performance software implementation of mpeg audio encoder, 1996, ICASSP Conf Proceedings (I think)

Fischer, K.A., Calculation of the psychoacoustic simultaneous masked threshold based on MPEG/Audio Encoder Model One, ICSI Technical Report, 1997 ftp://ftp.icsi.berkeley.edu/pub/real/kyrill/PsychoMpegOne.tar.Z

Hyen-O et al, New Implementation techniques of a real-time mpeg-2 audio encoding system. p2287, ICASSP 99.

Imai, T., et al, MPEG-1 Audio real-time encoding system, IEEE Trans on Consumer Electronics, v44, n3 1998. p888

Teh, D., et al, Efficient bit allocation algorithm for ISO/MPEG audio encoder, Electronics Letters, v34, n8, p721

Murphy, C & Anandakumar, K, Real-time MPEG-1 audio coding and decoding on a DSP Chip, IEEE Trans on Consumer Electronics, v43, n1, 1997 p40

Hans, M & Bhaskaran, V., A compliant MPEG-1 layer II audio decoder with 16-B arithmetic operations, IEEE Signal Proc Letters v4 n5 1997 p121

twolame's People

Contributors

aleksander0m avatar eblanca avatar impulze avatar jamrial avatar kierank avatar lfam avatar lifegpc avatar njh avatar qyot27 avatar rex4539 avatar sebastinas avatar vtorri avatar walisser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

twolame's Issues

Padding in layer II

I see in twolame the default behavior is to have padding disabled, instead lame sets this to enabled.
Out of curiosity, is there a particular reason for this different setting?
In case of padding, does the further byte provide more room for audio samples?

usage of DLL_EXPORT for symbol visibility is wrong

after applying PR #84 the compilation fails on Windows because of wrong declaration specification (DLL_EXPORT in twolame.h)

first, there is no need to define LIBTWOLAME_STATIC or LIBTWOLAME_DLL_EXPORTS : when using libtool, you know if libtool builds a DLL or not with the macro DLL_EXPORT (defined in case libtool builds the DLL, not defined otherwise)

so to define exported symbols i would not define DLL_EXPORT as it's a macro defined by libtool

i would do the following (that is what we do in our project) :

#ifdef _WIN32
#ifdef TWOLAME_BUILD
#ifdef DLL_EXPORT
#define TL_API __declspec(dllexport)
#else
#define TL_API
#endif
#else
#define TL_API __declspec(dllimport)
#endif
#else
#ifdef GNUC
#if GNUC >= 4
#define TL_API attribute ((visibility("default")))
#else
#define TL_API
#endif
#else
#define TL_API
#endif
#endif

-DTWOLAME_BUILD is passed to CPPFLAGS of the library in Makefile.am (used only on Windows, to specify that the DLL is built)

and i would use TL_API instead of DLL_EXPORT in front of all the exported symbols

this also the usage of visibility flag on unix.

after this change, everything compiles flawlessly

i can do a pull request if you want

frontend.c needs some tweaks to be built with MSVC

Hi, thanks for your works.

At line 740 of frontend.c, "int bytes_out" is declared at the middle of the block scope around it, therefore can't be compiled with compilers which doesn't support C99 (at least MSVC).
I also tried forcing C++ compilation, but C++ compilation also requires some fix, because of lines like this:
char *string = malloc(MAX_NAME_SIZE);
(This is legal in C, but not in C++: it requires explicit cast)

MPEG2.5

I see twolame does not encode files with samplerates 12000, 11025 and 8000 Hz, so it currently does not support mpeg2.5, although it shares bitrate values with 'plain' mpeg2.
Will this change in next releases?

stdin not working properly

If i use twolame reading bytes outputted to stdout with
sox, twolame doesn't read all bytes outputted to stdout.
If i use:
mpg321 /mnt/d/sound.mp2 --wav /dev/stdout | sox -t.wav
/dev/stdin -r 44100 -V -t.raw /dev/stdout lowpass 1900
| twolame -r -s 44100 -m s -b 224 -p /dev/stdin
/mnt/c/sound_fixed.mp2

The duration of sound.mp2 and sound_fixed.mp2 it's not
the same.
Seems that the start is ok and cuts off some bytes at
the end.
Using another files, the cutting is different.
I'm using mpg321 version 0.2.10
sox version 12.17.7
twolame version 0.3.8

If using the same commandline and replacing with
toolame(replacing the commandline different between
twolame and toolame) it works ok.

Silence encoding

When encoding floating point input WAV files, twolame creates a bitstream with silence.
The current libsndfile setting lacks the proper scaling value, needed in those cases. The result is, any value read from such files is imported with integer values in [-1, +1].
Lame has the scaling enabled, even thought the current behavior for libsndfile is auto-scaling floating point input sources, by default. This means changing the input (which is not always welcome) but, on the other hand, makes the encoding engine able to create useful files.
I will submit a patch for this asap.

no rule to make twolame.1

make[2]: *** Aucune règle pour fabriquer la cible « twolame.1 », nécessaire pour « all-am ». Arrêt.

means "no rule to make twolame.1"

Obsolete keyword

I see the code still uses some "register" keyword for a bunch of variables.
This used to be added as a suggestion to the compiler, which would use a cpu register instead of a memory location and get a faster access to a given variable, but nowadays this choice is better done by modern compilers, AFAIK.
What do you think about removing them all ?

Missing macro

In libtwolame/util.c, into 'get_twolame_url' an immediate string is used, while into config.h the macro PACKAGE_URL is empty. If only that macro was non-empty, then that would be used into 'get_twolame_url' for referring the site url.
Maybe something is missing into configure.ac but I'm not much into this for fixing by myself.

0.3.13: Test suite is freezing

[tkloczko@barrel twolame-0.3.13]$ make check
Making check in libtwolame
make[1]: Entering directory '/home/tkloczko/rpmbuild/BUILD/twolame-0.3.13/libtwolame'
make[1]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/twolame-0.3.13/libtwolame'
Making check in frontend
make[1]: Entering directory '/home/tkloczko/rpmbuild/BUILD/twolame-0.3.13/frontend'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/twolame-0.3.13/frontend'
Making check in simplefrontend
make[1]: Entering directory '/home/tkloczko/rpmbuild/BUILD/twolame-0.3.13/simplefrontend'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/twolame-0.3.13/simplefrontend'
Making check in doc
make[1]: Entering directory '/home/tkloczko/rpmbuild/BUILD/twolame-0.3.13/doc'
Making check in html
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/twolame-0.3.13/doc/html'
make[2]: Nothing to be done for 'check'.
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/twolame-0.3.13/doc/html'
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/twolame-0.3.13/doc'
make[2]: Nothing to be done for 'check-am'.
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/twolame-0.3.13/doc'
make[1]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/twolame-0.3.13/doc'
Making check in tests
make[1]: Entering directory '/home/tkloczko/rpmbuild/BUILD/twolame-0.3.13/tests'
make  test.pl \
  testcase-44100.wav testcase-22050.wav
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/twolame-0.3.13/tests'
make[2]: Nothing to be done for 'test.pl'.
make[2]: Nothing to be done for 'testcase-44100.wav'.
make[2]: Nothing to be done for 'testcase-22050.wav'.
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/twolame-0.3.13/tests'
make  check-TESTS
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/twolame-0.3.13/tests'
make[3]: Entering directory '/home/tkloczko/rpmbuild/BUILD/twolame-0.3.13/tests'
/bin/sh ....................... 

And that generally all.

In running processes I see only:

tkloczko 1109666  0.0  0.0 229756  8988 pts/8    Ss   Oct03   0:01  |               \_ bash -rcfile .bashrc
tkloczko 3063897  0.0  0.0 215660  2324 pts/8    S+   09:52   0:00  |                   \_ make check
tkloczko 3063898  0.0  0.0 216788  3848 pts/8    S+   09:52   0:00  |                       \_ /bin/sh -c fail=; \ if (target_option=k; case ${target_option-} in ?) ;; *
tkloczko 3063921  0.0  0.0 216788  1832 pts/8    S+   09:52   0:00  |                           \_ /bin/sh -c fail=; \ if (target_option=k; case ${target_option-} in ?) 
tkloczko 3063922  0.0  0.0 215540  2296 pts/8    S+   09:52   0:00  |                               \_ make check
tkloczko 3063924  0.0  0.0 215540  2408 pts/8    S+   09:52   0:00  |                                   \_ make check-TESTS
tkloczko 3063930  0.0  0.0 216656  3152 pts/8    S+   09:52   0:00  |                                       \_ /bin/sh -c set +e; bases='test.pl.log'; bases=`for i in $b
tkloczko 3063939  0.0  0.0 215540  2340 pts/8    S+   09:52   0:00  |                                           \_ make test-suite.log TEST_LOGS=test.pl.log
tkloczko 3063940  0.0  0.0 216788  3388 pts/8    S+   09:52   0:00  |                                               \_ /bin/sh -c p='test.pl'; \ b='test.pl'; \ case $- i
tkloczko 3063944  0.1  0.0 228764 13820 pts/8    S+   09:52   0:00  |                                                   \_ perl -w -Mstrict -MTest::Harness -e runtests(@
tkloczko 3063946  0.0  0.0 216656  3240 pts/8    S+   09:52   0:00  |                                                       \_ /bin/sh
[tkloczko@barrel SPECS]$ strace -p 3063946
strace: Process 3063946 attached
read(0, 

So it waits in read()

About layer II

I have two questions about layer II frame format.

  1. it seems the bit allocation stuff begins right after the header (eventually after the crc16) and the remaining room in frame is dedicated to the samples, so is it right to say any layer II stream may be safely cut at frame boundaries ?

  2. in a frame, is there an easy way to skip the samples and jump to the ancillary bytes (if any) ? In layer III the side information block offers (among other stuff) the so-called backpointer and the length of part2+part3, so it's easy to do this. What about layer II ? is there a similar information available ?

Thank you.

Swap bytes, when?

In frontend.c I see endian-ness care is taken for some difficult audio sources.
Now, is this needed when dealing with input samples coming from libsndfile?
Or is this just needed in case of raw sample sources?
I think the latter case is true (after all, if the frontend calls libsndfile services is because we trust them), so this special handling should be only done as part of raw input routines...
What do you think about this?

Apply and test patch to convert internal buffers to floats

Original tracker ticket:
https://sourceforge.net/tracker/?func=detail&aid=1760298&group_id=136040&atid=735435

Patch here:
https://gist.github.com/762513

I've attached a patch, that enables internal FLOAT buffer support. All internal 16 bit code has been replaced.

Should be compatible with existing interface.

It also replaces:


if ((filter[i][k] = 1e9 * cos ((FLOAT) ((2 * i + 1) * k * PI64))) >= 0)
  modf (filter[i][k] + 0.5, &filter[i][k]);
else
  modf (filter[i][k] - 0.5, &filter[i][k]);

With:

if ((filter[i][k] = 1e9 * cos ((FLOAT) ((2 * i + 1) * k * PI64))) >= 0) {
  filter[i][k] = (int)(filter[i][k] + 0.5);
} else {
  filter[i][k] = (int)(filter[i][k] - 0.5);
}

Since the former triggers a compiler error on MSVC++ 8, making it overwrite values in global_opt->smem->off[0].

Right now the internal buffer is the same as FLOAT is defined as in common.h - changing it from double to float results in a significant slowdown on windows - probably because there are a lot of float <-> double conversions needed. Functions would need to be replaced by float ones.

There are still some places that should be investigated:

psycho_1.c - Line 533 & psycho_1.c - Line 128:
max = 20 * log10 (scale[i] * 32768) - 10; /* level for each subband */

ath.c, line 98 - guess that one is for general confusion.

Regards, Klaus Post.

Floating point input samples and libsndfile (not a bug)

Just for you to know (can't remember whether I mentioned this before).
When libsndfile opens a floating point input file, its default behaviour is to scan the whole file and set an amplitude value so the input peak will be mapped to 1.0
This may result in an amplification (most of the cases) or an attenuation of the input signal, that is the input data get modified. I really think this shouldn't happen and I filed Erik a pull request here some time ago, in a way calling applications can set an amplitude value (most likely to be 1.0) so the input signal WON'T be changed.
This has not been merged yet, so as of today any time one wants to encode some content as floating point values, then this is what will happen.
Does this deserve a mention into README ?

Cannot configure

I just downloaded the tarball and ran autogen.sh, it found any of its dependencies (automake, autoconf, autoheader and others) but configure doesn't work, it stop and complains there is no `Makefile.in'. Well, actually I have several of these Makefile.in but not into the main directory. Anyway, here's the autogen.sh output:

$ ./autogen.sh
autogen.sh: Looking for programs: automake aclocal autoconf autoheader libtoolize
autogen.sh: automake program 'automake' V 011101 (min 011000) in /usr/bin
autogen.sh: aclocal program 'aclocal' V 011101 (min 011000) in /usr/bin
autogen.sh: autoconf program 'autoconf' V 026500 (min 026000) in /usr/bin
autogen.sh: autoheader program 'autoheader' V 026500 (min 026000) in /usr/bin
autogen.sh: libtoolize program 'libtoolize' V 020206 (min 020200) in /usr/bin
autogen.sh: Dependencies satisfied

autogen.sh: Processing directory .
autogen.sh: Running libtoolize --force --copy --automake
autogen.sh: Running aclocal -I build-scripts
/usr/share/aclocal/gtkglextmm-1.2.m4:225: warning: underquoted definition of AC_GTKGLEXTMM_SUPPORTS_MULTIHEAD
/usr/share/aclocal/gtkglextmm-1.2.m4:225: run info '(automake)Extending aclocal'
/usr/share/aclocal/gtkglextmm-1.2.m4:225: or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
autogen.sh: Running automake --gnu --add-missing --force --copy -Wall
configure.ac:15: installing build-scripts/config.guess' configure.ac:15: installingbuild-scripts/config.sub'
configure.ac:12: installing build-scripts/install-sh' configure.ac:12: installingbuild-scripts/missing'
frontend/Makefile.am: installing build-scripts/depcomp' configure.ac:142: required filelibtwolame/config.h.in' not found
autogen.sh: Running autoconf

autogen.sh: WARNING: Running configure' with no arguments. If you wish to pass any to it, please specify them on the autogen.sh' command line.
[snip]
checking for inttypes.h... (cached) yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
configure: creating ./config.status
config.status: error: cannot find input file: `Makefile.in'

Maybe some of the auto-tools are in the wrong version?

LT_INIT usage

Hello

in configure.ac, there are 2 LT_INIT (lines 53 and 59)
in addition, to allow the compilation of twolame, you should use LT_INIT like that :

LT_INIT([win32-dll)

if you want, i can provide a pull request (just tell me which LT_INIT you want to suppress)

Release version 0.4.0

hello

will the next release be out soon ? The current release has been out in 2017

thank you

A couple of padding policies

I see two different policies are applied when doing padding.

When I'm encoding 44.1 kHz or 22.05 kHz content and padding is selected, some frames are padded with a slot, so the bitrate results exact. This means somewhere an algorithm is evaluated in order to decide whether the current frame deserves to be padded or not.

But when I'm encoding 16/24/32/48 kHz content and padding is selected (I know there's no need in those cases), no algorithm is evaluated, so any frames are padded.

Those policies are different, and since the encoding frontend help says "--padding force padding bit/frame on", then this means the second behaviour is meant to be right. Actually, truth be told, I expected the former to be applied.

I see a contradiction in all this, do you?

update automake required version

we are in 2019, maybe increasing the required version of automake to at least 1.11 would be nice :) anyway, it's something than users of the released tarball won't see.

make job failure due to doc/ directory not being ignored

It's not causing the lib or bins to fail, since it's occurring right at the end, but it does cause make to fail, which can interfere with automated installation.

I do not have doxygen or asciidoc installed, and as per the response in issue #41, this should mean that docs aren't built. The problem is that make is still attempting to dive into doc/ and build them anyway.

I've tried explicitly passing --disable-maintainer-mode as well, just in case maintainer mode is on by default (which it shouldn't be if it is, but still), but the exact same error results. It also happens regardless of whether I'm compiling natively for Linux or cross compiling with MinGW-w64.

Ideally, docs (and the frontends, even though it's far more likely to build those) could be enabled/disabled at configure time and then the directories passed through to make accordingly. My attempts to wriggle a solution like that into configure.ac/Makefile.am yesterday never actually worked as I wanted it to (it just kept skipping docs and frontends entirely, even if I just wanted to skip the docs directory), so I'm just filing a normal bug report instead.

Compilation log:

[~:$] git clone git://github.com/njh/twolame.git
Cloning into 'twolame'...
remote: Counting objects: 2068, done.
remote: Total 2068 (delta 0), reused 0 (delta 0), pack-reused 2068
Receiving objects: 100% (2068/2068), 892.26 KiB | 0 bytes/s, done.
Resolving deltas: 100% (1446/1446), done.

[~:$] cd twolame && mkdir build-scripts

[twolame:$] autoreconf -fiv
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I build-scripts
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-scripts'.
libtoolize: copying file 'build-scripts/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'build-scripts'.
libtoolize: copying file 'build-scripts/libtool.m4'
libtoolize: copying file 'build-scripts/ltoptions.m4'
libtoolize: copying file 'build-scripts/ltsugar.m4'
libtoolize: copying file 'build-scripts/ltversion.m4'
libtoolize: copying file 'build-scripts/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:48: installing 'build-scripts/ar-lib'
configure.ac:48: installing 'build-scripts/compile'
configure.ac:53: installing 'build-scripts/config.guess'
configure.ac:53: installing 'build-scripts/config.sub'
configure.ac:17: installing 'build-scripts/install-sh'
configure.ac:17: installing 'build-scripts/missing'
frontend/Makefile.am: installing 'build-scripts/depcomp'
parallel-tests: installing 'build-scripts/test-driver'
autoreconf: Leaving directory `.'

[twolame:$] CPPFLAGS="-mfpmath=sse -march=pentium3 -msse -mtune=pentium3" \
>     PKG_CONFIG_PATH=/usr/i686-w64-mingw32/lib/pkgconfig ./configure \
>     --prefix=/usr/i686-w64-mingw32 --disable-shared --enable-silent-rules \
>     --host=i686-w64-mingw32
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for i686-w64-mingw32-strip... i686-w64-mingw32-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for i686-w64-mingw32-gcc... i686-w64-mingw32-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether i686-w64-mingw32-gcc accepts -g... yes
checking for i686-w64-mingw32-gcc option to accept ISO C89... none needed
checking whether i686-w64-mingw32-gcc understands -c and -o together... yes
checking dependency style of i686-w64-mingw32-gcc... gcc3
checking for i686-w64-mingw32-ar... i686-w64-mingw32-ar
checking the archiver (i686-w64-mingw32-ar) interface... ar
checking for i686-w64-mingw32-gcc... (cached) i686-w64-mingw32-gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether i686-w64-mingw32-gcc accepts -g... (cached) yes
checking for i686-w64-mingw32-gcc option to accept ISO C89... (cached) none needed
checking whether i686-w64-mingw32-gcc understands -c and -o together... (cached) yes
checking dependency style of i686-w64-mingw32-gcc... (cached) gcc3
checking for i686-w64-mingw32-gcc option to accept ISO C99... none needed
checking whether ln -s works... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... i686-w64-mingw32
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by i686-w64-mingw32-gcc... /usr/i686-w64-mingw32/bin/ld
checking if the linker (/usr/i686-w64-mingw32/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/i686-w64-mingw32-nm -B
checking the name lister (/usr/bin/i686-w64-mingw32-nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to i686-w64-mingw32 format... func_convert_file_nix_to_w32
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/i686-w64-mingw32/bin/ld option to reload object files... -r
checking for i686-w64-mingw32-objdump... i686-w64-mingw32-objdump
checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
checking for i686-w64-mingw32-dlltool... i686-w64-mingw32-dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_implib
checking for i686-w64-mingw32-ar... (cached) i686-w64-mingw32-ar
checking for archiver @FILE support... @
checking for i686-w64-mingw32-strip... (cached) i686-w64-mingw32-strip
checking for i686-w64-mingw32-ranlib... i686-w64-mingw32-ranlib
checking command to parse /usr/bin/i686-w64-mingw32-nm -B output from i686-w64-mingw32-gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for i686-w64-mingw32-mt... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... i686-w64-mingw32-gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... no
checking for objdir... .libs
checking if i686-w64-mingw32-gcc supports -fno-rtti -fno-exceptions... no
checking for i686-w64-mingw32-gcc option to produce PIC... -DDLL_EXPORT -DPIC
checking if i686-w64-mingw32-gcc PIC flag -DDLL_EXPORT -DPIC works... yes
checking if i686-w64-mingw32-gcc static flag -static works... yes
checking if i686-w64-mingw32-gcc supports -c -o file.o... yes
checking if i686-w64-mingw32-gcc supports -c -o file.o... (cached) yes
checking whether the i686-w64-mingw32-gcc linker (/usr/i686-w64-mingw32/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking whether byte ordering is bigendian... no
checking for inline... inline
checking for an ANSI C-conforming const... yes
checking for perl... /usr/bin/perl
checking size of short... 2
checking size of float... 4
checking for sqrt in -lm... yes
checking for lrintf in -lm... yes
checking for powf in -lmx... no
checking for i686-w64-mingw32-pkg-config... /usr/bin/i686-w64-mingw32-pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for SNDFILE... yes
checking for ANSI C header files... (cached) yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking assert.h usability... yes
checking assert.h presence... yes
checking for assert.h... yes
checking for unistd.h... (cached) yes
checking for inttypes.h... (cached) yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating twolame.pc
config.status: creating doc/Makefile
config.status: creating doc/html/Makefile
config.status: creating doc/html/Doxyfile
config.status: creating libtwolame/Makefile
config.status: creating frontend/Makefile
config.status: creating simplefrontend/Makefile
config.status: creating tests/Makefile
config.status: creating libtwolame/config.h
config.status: executing depfiles commands
config.status: executing libtool commands

[twolame:$] make -j4
Making all in libtwolame
make[1]: Entering directory '/home/qyot27/twolame/libtwolame'
make  all-am
make[2]: Entering directory '/home/qyot27/twolame/libtwolame'
  CC       availbits.lo
  CC       ath.lo
  CC       bitbuffer.lo
  CC       crc.lo
  CC       dab.lo
  CC       encode.lo
  CC       energy.lo
  CC       fft.lo
  CC       get_set.lo
  CC       mem.lo
  CC       psycho_0.lo
  CC       psycho_1.lo
  CC       psycho_2.lo
  CC       psycho_3.lo
  CC       psycho_4.lo
  CC       psycho_n1.lo
  CC       subband.lo
  CC       twolame.lo
  CC       util.lo
  CCLD     libtwolame.la
libtool: warning: undefined symbols not allowed in i686-w64-mingw32 shared libraries; building static only
make[2]: Leaving directory '/home/qyot27/twolame/libtwolame'
make[1]: Leaving directory '/home/qyot27/twolame/libtwolame'
Making all in frontend
make[1]: Entering directory '/home/qyot27/twolame/frontend'
  CC       audioin_raw.o
  CC       frontend.o
  CC       audioin_sndfile.o
  CCLD     twolame.exe
make[1]: Leaving directory '/home/qyot27/twolame/frontend'
Making all in simplefrontend
make[1]: Entering directory '/home/qyot27/twolame/simplefrontend'
  CC       simplefrontend.o
  CC       audio_wave.o
  CCLD     stwolame.exe
make[1]: Leaving directory '/home/qyot27/twolame/simplefrontend'
Making all in doc
make[1]: Entering directory '/home/qyot27/twolame/doc'
Making all in html
make[2]: Entering directory '/home/qyot27/twolame/doc/html'
make[2]: *** No rule to make target 'doxygen.css', needed by 'all-am'.  Stop.
make[2]: Leaving directory '/home/qyot27/twolame/doc/html'
Makefile:481: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/qyot27/twolame/doc'
Makefile:469: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

[twolame:$] 

vbr mode

It appears only mono files with vbr can be played correctly.

Is this twolame issue or there is simply no decoder which can play such files?

"bit_stream buffer needs to be bigger" may this be an issue?

I found that for some particular encodings this message gets continously printed (no buffer overflows generated, now) and a corrupted bitstream is created.
Those are the cases of audio sources with very low samplerate encoded at very high bitrates (and free format encodings turn out to be the case): try encoding a 16 kHz source at 456 kbps and you'll have this.
Now, one may argue whether generating streams with such high bitrates may make sense, nevertheless lame allows for free format encodings up to 640 kbps and it would be great to have the same freedom in twolame.

Root: the root of this behaviour is into some library assumptions about bit_stream buffer (and its use), assumptions that may be wrong in those cases.

Fixes:

  1. if your primary goal is releasing ASAP a new library version, then a quick fix may be applied and it will be straightforward: set an upper bound for freeformat encodings (maybe 320 kbps / 400 kbps or such).

  2. if some time is available, then I would put some effort in fixing those assumptions and change how the library manages those buffers.

Tell me what you think, Nicholas.

Cleaning operation

In libtwolame/mem.h I see the macro (useful, indeed) TWOLAME_FREE which is defined as follows:
if(ptr!=NULL) { free(ptr); ptr=NULL; }
Now, what's the point in setting to NULL a parameter passed as value?
The caller will never see the change.
I don't get this.

Test failure with Perl 5.24

Hi,

I'm working on distro packaging for GNU Guix. While building twolame with Perl 5.24.0, TwoLAME's test suite began fails like this:

Making check in libtwolame
make[1]: Entering directory '/tmp/guix-build-twolame-0.3.13.drv-0/twolame-0.3.13/libtwolame'
make[1]: Leaving directory '/tmp/guix-build-twolame-0.3.13.drv-0/twolame-0.3.13/libtwolame'
Making check in frontend
make[1]: Entering directory '/tmp/guix-build-twolame-0.3.13.drv-0/twolame-0.3.13/frontend'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/tmp/guix-build-twolame-0.3.13.drv-0/twolame-0.3.13/frontend'
Making check in simplefrontend
make[1]: Entering directory '/tmp/guix-build-twolame-0.3.13.drv-0/twolame-0.3.13/simplefrontend'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/tmp/guix-build-twolame-0.3.13.drv-0/twolame-0.3.13/simplefrontend'
Making check in doc
make[1]: Entering directory '/tmp/guix-build-twolame-0.3.13.drv-0/twolame-0.3.13/doc'
Making check in html
make[2]: Entering directory '/tmp/guix-build-twolame-0.3.13.drv-0/twolame-0.3.13/doc/html'
make[2]: Nothing to be done for 'check'.
make[2]: Leaving directory '/tmp/guix-build-twolame-0.3.13.drv-0/twolame-0.3.13/doc/html'
make[2]: Entering directory '/tmp/guix-build-twolame-0.3.13.drv-0/twolame-0.3.13/doc'
make[2]: Nothing to be done for 'check-am'.
make[2]: Leaving directory '/tmp/guix-build-twolame-0.3.13.drv-0/twolame-0.3.13/doc'
make[1]: Leaving directory '/tmp/guix-build-twolame-0.3.13.drv-0/twolame-0.3.13/doc'
Making check in tests
make[1]: Entering directory '/tmp/guix-build-twolame-0.3.13.drv-0/twolame-0.3.13/tests'
make  test.pl \
  testcase-44100.wav testcase-22050.wav
make[2]: Entering directory '/tmp/guix-build-twolame-0.3.13.drv-0/twolame-0.3.13/tests'
make[2]: Nothing to be done for 'test.pl'.
make[2]: Nothing to be done for 'testcase-44100.wav'.
make[2]: Nothing to be done for 'testcase-22050.wav'.
make[2]: Leaving directory '/tmp/guix-build-twolame-0.3.13.drv-0/twolame-0.3.13/tests'
make  check-TESTS
make[2]: Entering directory '/tmp/guix-build-twolame-0.3.13.drv-0/twolame-0.3.13/tests'
Array passed to stat will be coerced to a scalar (did you want stat $_[0]?) at ./test.pl line 188.

#   Failed test '[1] file size of output file'
#   at ./test.pl line 136.
#          got: undef
#     expected: '13772'

#   Failed test '[2] file size of output file'
#   at ./test.pl line 136.
#          got: undef
#     expected: '13792'

#   Failed test '[3] file size of output file'
#   at ./test.pl line 136.
#          got: undef
#     expected: '2298'

#   Failed test '[4] file size of output file'
#   at ./test.pl line 136.
#          got: undef
#     expected: '13772'
# Looks like you failed 4 tests of 77.
./test.pl .. 
Dubious, test returned 4 (wstat 1024, 0x400)
Failed 4/77 subtests 

Test Summary Report
-------------------
./test.pl (Wstat: 1024 Tests: 77 Failed: 4)
  Failed tests:  16, 33, 50, 67
  Non-zero exit status: 4
Files=1, Tests=77,  1 wallclock secs ( 0.05 usr  0.00 sys +  0.12 cusr  0.01 csys =  0.18 CPU)
Result: FAIL
Failed 1/1 test programs. 4/77 subtests failed.
FAIL: test.pl
======================================================
1 of 1 test failed
Please report to [email protected]
======================================================
make[2]: *** [Makefile:230: check-TESTS] Error 1
make[2]: Leaving directory '/tmp/guix-build-twolame-0.3.13.drv-0/twolame-0.3.13/tests'
make[1]: *** [Makefile:343: check-am] Error 2
make[1]: Leaving directory '/tmp/guix-build-twolame-0.3.13.drv-0/twolame-0.3.13/tests'
make: *** [Makefile:301: check-recursive] Error 1

I don't know Perl well, but it seems related to this change in Perl:
http://perl5.git.perl.org/perl.git/commit/637494ac7ab11f737c47bf95a2c3a27ef1117984

What do you think about this issue? Is there a real problem using TwoLAME with Perl 5.24.0? Or is the test failure spurious?

twolame outputs a file with wrong audio duration

@njh,

converting the WAVE version from https://soundbible.com/2008-0-9-Male-Vocalized.html (direct download) using twolame, the resulting MP3 file gives wrong audio duration.

Flash animation (remove .txt extension to drag and drop at https://ruffle.rs/demo/).

Both lame and twolame are invoked using -m m -b 32.

lame outputs has a duration of 12278ms and twolame has a duration of 6113ms.

Of course, the official Flash player gives the same numbers.

I wonder whether it would be possible to fix twolame, so that audio duration info isn’t wrong.

Many thanks for your help and your excellent work.

Remove deprecated functions

  • DLL_EXPORT int twolame_set_VBR_q(twolame_options * glopts, float level);
  • DLL_EXPORT float twolame_get_VBR_q(twolame_options * glopts);

Does this require incrementing the major version number?

Towards 0.4.0

Do you see any blocking point to be fixed before 0.4.0 release?

reserved identifier violation

I suggest to try the search pattern "<(?:(?:(.*))|([A-Z]+))" on source files.
Some places will be found where names begin with two underscores or an underscore and an uppercase letter.

Examples:

This does not fit to the expected naming conventions of the C language standard.
I recommend to adjust your selection for unique names.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.