Help - Search - Members - Calendar
Full Version: Trim Flac (Is possible?)
Hydrogenaudio Forums > Lossless Audio Compression > FLAC
Sniffer
Hi again biggrin.gif ,

I want to know if there is any tool like MP3Trim that remove the beggining silence and the end silence from a music but To any Lossless Format.

My reasons: Why Lossless and not Mp3

Because i want the highest quality
Because i don't need hardware support, because i record in realtime to My Minidisc
Because i can change without loosing quality.....


BUT

because space is also important...... i really want to know if there is any tool out there, in special for FLAC/APE Or LA.


Thanks for all your time. wink.gif
tigre
QUOTE
because space is also important...... i really want to know if there is any tool out there, in special for FLAC/APE Or LA.

On silence lossless compression reaches very high compression ratios, so you won't save much space by trimming. I don't know a program for this but if a tool like MP3Trim exists for .wav files, it'd be quite easy to trim any lossless format automatically using a batch script that does decode to .wav -> trim -> encode to lossless .
I suggest to try doing it manually first to find out if the space saved is worth the effort.
Emanuel
QUOTE(tigre @ Aug 14 2003, 04:02 PM)
On silence lossless compression reaches very high compression ratios,

AFAIK only on digital silence (which not always can be distinguished from "almost silence")

Batch is probably the way to go ATM.
Lego
AFAIK you can use the "EAC Options" [F9] > "Extraction" > "Delete leading and trailing silent Blocks" . But i have never used it, no experience made with the effects using this Option.
Ardax
QUOTE(Emanuel @ Aug 14 2003, 11:17 AM)
AFAIK only on digital silence (which not always can be distinguished from "almost silence")

Yes. "almost silence" or "analog silence" often looks like white noise to an encoder, and is almost completely incompressible.

That said, I'll agree with the "go batch, but it may not be worth the time/trouble" sentiment.
TrNSZ
I'm not sure why you want to do this.

While such "trimming" might be appropriate on a lossy codec, why would you want to do this with a lossless codec? I thought the purpose of using a lossless codec was to ensure that you have an exact copy of the audio. Mangling your files by trimming digital silence or "analog" near-silence from them seems to defeat the purpose.

There are a few solutions, but you should first decode your working file to WAV. You can try to use EAC as mentioned. You could also do it using CEP or SoundForge.

You can probably also use foobar2000 by setting the Diskwriter component to use DSP (Don't reset DSP between files) to use foo_dsp_nogaps [2000ms/smooth] -> foo_dsp_skip_silence [2000ms/48db]. You might need to play with the silence Threshold to get the desired results.

If you are determined to go lossless and save space, you might be better off writing a batch file or 4NT BTM that compresses your WAV file using a variety of lossless encoders and encoder settings, and then removes all but the smallest output. I did something like this for myself, and while it's slow, it works very well.

Remember, if you use foobar2000, you can also read WAV data inside of ZIP and RAR files, so you can include these formats too, just for fun.

Edit 1: Spelling.
NumLOCK
QUOTE(Ardax @ Aug 14 2003, 08:39 PM)
Yes.  "almost silence" or "analog silence" often looks like white noise to an encoder, and is almost completely incompressible.

This is completely wrong.

Take a CD with ~96dB dynamics. Analog silence may be, for example, at -60 dB from digital max. At this level each sample (if it's truly random) can be coded in about 6 bits. Thus a compression factor of around 3.
eltoder
QUOTE(NumLOCK @ Aug 15 2003, 03:34 AM)
QUOTE(Ardax @ Aug 14 2003, 08:39 PM)
Yes.  "almost silence" or "analog silence" often looks like white noise to an encoder, and is almost completely incompressible.

This is completely wrong.

Take a CD with ~96dB dynamics. Analog silence may be, for example, at -60 dB from digital max. At this level each sample (if it's truly random) can be coded in about 6 bits. Thus a compression factor of around 3.

Absolutely right.

So, you won't save much space by trimming. By if you really want, you can just do it in any editor. There won't be any loss introduced by reencoding wink.gif

As for special automated tool - it's possible with FLAC, but I haven't heard of one.

-Eugene
M
I asked Jason Jordan (author of Shntool) about the possibility of adding such a feature earlier this afternoon. Here's an excerpt from his reply:
QUOTE
I thought about adding that feature a long time ago, but in the end I decided to confine shntool to non-destructive WAVE operations.  But, as it already does zero-padding, why not do the reverse?  Zero-unpadding, if you will.  smile.gif  I suppose I can relax my original restrictions on shntool's scope to only allow the addition or deletion of silence - as long as the audible part of the audio is not affected, things should be peachy, right?


Assuming this does wind up in the next release of Shntool, eliminating the leading/trailing digital silence from an audio file would be possible with any supported lossless codec. Should be an update in the relatively near future.

- M.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.