David Liontooth wrote:
On Thu, 31 May 2007, Francesco Romani wrote:

On Wed, 2007-05-30 at 21:10 -0700, David Liontooth wrote:
Hi Cyrus and Francesco,

I've solved the same problem by using tcextract and cutmp3; I'd be happy to send the scripts.
And I'll happy to see them :)

It would be great if transcode could handle it!
This shouldn't be too much work, it's matter to refactor/empower a bit
filter_astat and/or filter_detectsilence.
The real problem is that... real life work chases me restlessly :\

Hey, run for your life :)
The following is very home-made stuff, but it works reliably (needs the
latest cutmp3 -- check it out if you need ideas for how to detect
silence):

 http://owens.cogweb.net/soundmerge.sh

As a rough measure, but fast, I also extract the mp3 file and compress it to ogg using sox (pre 13.0), and then compare the sizes -- might be of interest to Cyrus:

# Check for flags and assign variables

if [ -e "$1/$2.avi" ] && [[ "$3" = [12345] ]]
  then DIR="$1" ; FIL="$2" ; DEV="$3"
  else echo -e "\nSee /usr/local/bin/audio-check-file for syntax.\n"
fi

# Define the audio working directory
AUDIR="/tvspare/tmp" ; if [ ! -d $AUDIR ] ; then mkdir -p -m 775 $AUDIR ; fi

# Extract the audio portion of the captured file and convert it to ogg
if [ ! -s "$AUDIR/$FIL.mp3" ] ; then tcextract -i $DIR/$FIL.avi -x mp3 -a 3 > $AUDIR/$FIL.mp3 ; fi if [ ! -s "$AUDIR/$FIL.ogg" ] ; then sox $AUDIR/$FIL.mp3 -r 500 -p -c 1 $AUDIR/$FIL.ogg ; fi

# Generate a ratio
MP3SIZE=$(ls -l $AUDIR/$FIL.mp3 | cut -d' ' -f5)
OGGSIZE=$(ls -l $AUDIR/$FIL.ogg | cut -d' ' -f5)

SCORE=$(( $MP3SIZE/$OGGSIZE ))

# Check the ratio for dropped audio (smaller files get higher scores)
if [ $SCORE -gt 53 -a $MP3SIZE -gt 45000000 -o $SCORE -gt 54 ]
then DROPPED="$(( ($MP3SIZE/958406)-($OGGSIZE/18550) ))" ; PERCENT="$(( ($DROPPED*100)/($MP3SIZE/958406) ))" echo -e "\nDROPPED SOUND FOR $DROPPED MINUTES ($PERCENT%, RAW SCORE $SCORE) in $FIL.avi\n"
 else echo -e "\nSound checks out fine ($SCORE) in $FIL.avi\n"
fi





Unfortunately, this didn't work for me. Soundmerge simply says "There is no dropped sound" for both test files, one of which is silent, and the other is not.

Here are the two files:

http://wtvq.dynalias.com/soundtest.mp3 (silent audio)
http://wtvq.dynalias.com/soundtest2.mp3 (has audio)

Here is my output. Please let me know what I should do differently.

---------------------------------

[EMAIL PROTECTED] transcode]# ./soundmerge.sh soundtest.mp3

Moving the files to a working directory, /usr/local/transcode/z


Searching for dropped audio on Monday June 11, 2007 at 11:52:30 AM -- this can take several minutes

       soundtest.mp3

               There is no dropped sound

       Give two filenames if you want to merge audio!

[EMAIL PROTECTED] transcode]# ./soundmerge.sh soundtest2.mp3

Moving the files to a working directory, /usr/local/transcode/z


Searching for dropped audio on Monday June 11, 2007 at 11:52:39 AM -- this can take several minutes

       soundtest2.mp3

               There is no dropped sound

       Give two filenames if you want to merge audio!








Reply via email to