views:

34

answers:

2

Hi there. I'm using swfdump to be able to get the ID number of an audio file. Here is what I'm using:

swfdump -D /Users/home/folder/file.swf | grep -i mp3

That is outputting: [00e] 28999 DEFINESOUND defines id 0006 (MP3 22Khz 16Bit mono)

What I need is the id #..in this case it is 0006. i want that number in a variable. Anyone know how to do this?

+1  A: 
var=$(swfdump -D /Users/home/folder/file.swf | sed '/MP3/s/.*id //;s/ (.*//')

or Bash

$ s=$(swfdump -D /Users/home/folder/file.swf)
$ var=${s/(MP3*}
$ echo $var
0006
ghostdog74
Unfortunately, neither of these work...swfdump dumps all the decompiled swf contents. The first example doesn't narrow it down at all. The second example cuts the decompiled swf contents down a bit but still no id.
Keith
+1  A: 
the_id=`swfdump -D /Users/home/folder/file.swf | grep -i mp3 | cut -d' ' -f6`
Nikolai N Fetissov
This seems to work but I have the wrong id...the above gives me 28999...and I want the 0006.
Keith
O.K. got it...-f10 did it.
Keith