PDA

View Full Version : Add a fade in an ac3 file without reencoding all of it.


mitsubishi
21st January 2008, 19:16
I've tried a number of methods, but can't get the resulting file to behave. I want to take a 384 bit ac3 file then add to it from another file ( a 444kbit at same sample rate) with the second file faded in.

I've tried in various combinations. Azid, besplit (join), binary copy, delaycut, audacity, nerowave editor, enWavtoAC3 (aften front-end) and demos of Sony Sound Forge and AC3toolsPro.

I think the problem is in the joining. I can create the section I want with two second fade in, encoded with the same mode and levels in encWavToAC3 (as azid reports them). The file sounds right on its own, but when mixed with the start piece it fades in over 10 seconds. There is a BSI header at the start of the section, but it is the same as the BSI at the start of the file and other files with BSI sections don't seem to fade like this.

So can I get the file to mix properly and in a way that will playback consistently with different decoders?
And can I strip the second BSI header somehow?

pc_speak
22nd January 2008, 12:33
Hi.

I tried this on two files, but they had the same bitrate (384).
Played with a 2 second FadeOut and a 2 second FadeIn and it sounded pretty smooth.
There is an re-encode of the lot.
Don't know if this helps in your scheme of things. But it was fun. :D And pretty fast.
Hmmm. Will it work with different decoders?

I've used http://nic.dnsalias.com/nixaudiostuff.html for AC3.

audio.avs
a=NicAC3Source("a1.ac3").FadeOut0( 50, 0, 25)
b=NicAC3Source("a2.ac3").FadeIn0( 50, 0, 25)
a+b

bepipe.exe --script "import(^audio.avs^)" | aften.exe -v 0 -b 256 -m 0 -readtoeof 1 -cmix 0 -smix 0 -dsur 0 -dnorm 31 -dynrng 5 - "newaudio.ac3"



From here: http://avisynth.org/oldwiki/index.php?page=Fade

jruggle
22nd January 2008, 18:22
So can I get the file to mix properly and in a way that will playback consistently with different decoders? And can I strip the second BSI header somehow?
You don't need to strip any headers. AC3 does not have file headers, just a series of frames, each with its own little header. So you should be able to simply join any 2 ac3 files together. Decoders are supposed to be able to handle any changes, but some may not like if it you change the number of channels or samplerate. Other things such as bitrate or metadata changes should be handled just fine.

One thing to consider is that each frame uses 256 samples from the previous frame, so if it was not encoded as all one piece, you may get a short blip of distortion at transitions. It just depends on the content.

-Justin

mitsubishi
23rd January 2008, 16:39
OK,thanks.

I got a copy of the specs and am going to try examining the result more closely.

EDIT: I forgot to say, I'm sure it's something to do with how the decoder responds to the headers, loading the joined file into Nero Wave Editor, it is how it should be. Also playing it in VLC it is fine, it's just AC3parser that introduces this long fade. (I've not tried muxing yet though, so maybe with just AC3filter it might be different...