swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swftools-common] replacing sound in a swf?


From: Matthias Kramm
Subject: Re: [Swftools-common] replacing sound in a swf?
Date: Sun, 27 Jul 2008 12:23:27 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

On Sat, Jul 19, 2008 at 02:30:48AM -0400, Bill Hall <address@hidden> wrote:
> Is it possible to replace the sound in a swf using swftools?   I tried to
> use wav2swf then swfcombine -T vid.swf aud.swf   but the output swf has both
> sound streams.
> We are trying to  replace the English narration track with a German
> translation in this example.
> 
> I had hoped there was some trick I  could do with swftools to delete or
> replace the original sound track.

The swfcombine way should work, if you remove the sound track from the
old file first, which is admittedly a bit tricky.
You can use swfedit (a debug tool I wrote for myself which is not
included in the snapshots, only CVS, and which you can compile
by doing "cd src;make swfedit")-
run it once on the SWF file to get a sort of hex dump, remove all
SOUNDSTREAM and SOUNDSTREAMHEAD blocks, then run swfedit on the
edited text file.
The second option would be to use the Python SWF interface to remove
all tags, which is probably easier if you get the Python interface
to work:

#!/usr/bin/python

import sys
import SWF

swf1 = SWF.load("input.swf")
swf2 = SWF.create(version=swf1.version, bbox=swf1.bbox, fps=swf1.fps)
for tag in swf1.tags:
    if "SOUNDSTREAM" not in tag.name: # soundstreamhead, soundstreamblock etc.
        swf2.tags += tag
swf2.save("file-without-soundtrack.swf")

Greetings

Matthias






reply via email to

[Prev in Thread] Current Thread [Next in Thread]