Results 1 to 4 of 4

Thread: converting flac files to mp3 results in 0.047 seconds silence in beginning

  1. #1
    Join Date
    Apr 2006
    Location
    Norway
    Beans
    54
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    converting flac files to mp3 results in 0.047 seconds silence in beginning

    i've exported some flac files from hydrogen 0.9.6-svn-exported. when i run the following command in the terminal:
    Code:
    for f in *.flac;do flac -cd "$f"|lame -h - "${f%.flac}.mp3";done
    the resulting mp3 files all have 0.047 seconds of silence at the beginning of the file. anybody else experience this or know what i could possibly be doing wrong?

    flac file info:
    sample rate: 48000 Hz
    bitrate: 1676 kbps

    resulting mp3 file info:
    codec: MPEG 1 audio, layer 3 (mp3)
    sample rate: 48000 Hz
    bitrate: 128 kbps

    flac version: 1.2.1
    lame version: 3.98.4 64bits

    i've attached a sample flac source file, plus the resulting mp3

    this appears to be a "lame" bug because converting from both flac and wav results in mp3 files with the 47 milliseconds of silence in the beginning.

    when i try convert a flac to mp3 using sox (which uses libsox-fmt-mp3 14.3.2-1ubuntu1):
    Code:
    sox input.flac output.mp3
    i get 0.023 seconds of silence in the beginning of the mp3 file instead of 0.047.
    Attached Files Attached Files
    Last edited by nickleus; February 18th, 2012 at 06:16 PM. Reason: added info about converting from wav files to mp3 and using sox
    Nick Humphrey
    Download my experimental music for free.
    Help me improve my phrasebook of world languages.

  2. #2
    Join Date
    Oct 2007
    Location
    Oregon, USA
    Beans
    1,534

    Re: converting flac files to mp3 results in 0.047 seconds silence in beginning

    MP3 isn't natively gapless. You have to tell LAME to write header information for specific sequence of files. Maybe you are seeing something related to that. I don't see any --nogap/--nogaptags switches in your command.

  3. #3
    Join Date
    Apr 2006
    Location
    Norway
    Beans
    54
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: converting flac files to mp3 results in 0.047 seconds silence in beginning

    Quote Originally Posted by Chronon View Post
    MP3 isn't natively gapless.
    i've never experienced this before, so i am thinking this must be the result of some ~recent change.

    Quote Originally Posted by Chronon View Post
    I don't see any --nogap/--nogaptags switches in your command.
    from the lame man page:
    --nogap file1 file2 ...
    gapless encoding for a set of contiguous files
    Code:
    lame -h --nogap *.wav
    still produces the beginning silence.

    with nogaptags (not in the man page, but visible with "lame --longhelp"):
    Code:
    lame -h --nogaptags --nogap *.wav
    creates an even longer silence/delay in the beginning.
    Last edited by nickleus; February 22nd, 2012 at 01:30 PM. Reason: added source of nogaptags info
    Nick Humphrey
    Download my experimental music for free.
    Help me improve my phrasebook of world languages.

  4. #4
    Join Date
    Apr 2006
    Location
    Norway
    Beans
    54
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: converting flac files to mp3 results in 0.047 seconds silence in beginning

    the problem was pulseaudio:
    http://sourceforge.net/mailarchive/f..._name=lame-dev

    when played with ALSA only, and not ALSA running under pulse, then it loops correctly. the silence was apparently expected/default behavior when encoding to mp3.
    Nick Humphrey
    Download my experimental music for free.
    Help me improve my phrasebook of world languages.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •