Package: dvd-slideshow
Version: 0.8.4.2-2
Severity: grave
Tags: patch

Dear Maintainer,

With this minimal test case:

---8<---
$ cat > test <<EOT
title:5:The Title
EOT
$ dvd-slideshow -V 2 -mp4 test
[dvd-slideshow]            dvd-slideshow 0.8.4-1
[dvd-slideshow]            Licensed under the GNU GPL
[dvd-slideshow]            Copyright 2003-2011 by Scott Dylewski
[dvd-slideshow]            
[dvd-slideshow] Using default slideshow name: test
[dvd-slideshow] Output directory not specified.
[dvd-slideshow] Using /home/thep/tmp/dvd-slideshow
[dvd-slideshow] Parsing input file test
[dvd-slideshow] ####################
[dvd-slideshow] Found 0 images.
[dvd-slideshow] Found 0 audio files.
[dvd-slideshow] Found 0 background slides.
[dvd-slideshow] Found 1 title slides.
[dvd-slideshow] Found 0 transitions (fadein/fadeout/crossfade/wipe).
[dvd-slideshow] sq_to_dvd_pixels=100.00x100%
[dvd-slideshow] Video: NTSC 320x240 29.97fps 4:3
[dvd-slideshow] Audio: AC3 44100 128k
[dvd-slideshow] Debug=2  Autocrop=0 Subtitles=dvd Border=0
[dvd-slideshow] Using SMP optimizations for multi-processor machines
[dvd-slideshow] Title_font=...r/share/fonts/type1/gsfonts/n019004l.pfb
[dvd-slideshow] Subtitle_font=...r/share/fonts/type1/gsfonts/n019004l.pfb
[dvd-slideshow] Running initial error check...
line 3 file=title duration=5 subtitle=The Title effect1=
[dvd-slideshow] Total audio length = 
[dvd-slideshow] Total video length = 0:0:5.000
[dvd-slideshow] Temp dir is ...mp/dvd-slideshow/dvd-slideshow_temp_2068
[dvd-slideshow] Exporting .mp4 file
[dvd-slideshow] Creating black background
[dvd-slideshow]############################################################
[dvd-slideshow] start_frame_number=0 start_time=0:0:0.000
[dvd-slideshow] Title 0:0:5.000
[dvd-slideshow]         Title=The Title
[dvd-slideshow] rendered_frames=150
[dvd-slideshow] end_frame_number=150 end_time=0:0:5.000
[dvd-slideshow]############################################################
[dvd-slideshow] subtitle_start=0:0:0.000 subtitle_end=0:0:5.000
[dvd-slideshow] waiting for encoder to finish...
[dvd-slideshow]#####################################
[dvd-slideshow] No audio files passed. Using 0:0:5.000 silence.
[dvd-slideshow] Working on track 1 audio file 1
[dvd-slideshow] silence
[dvd-slideshow] Creating silence audio file for 0:0:5.000
sox WARN sox: Option `-s' is deprecated, use `-e signed-integer' instead.
sox WARN sox: Option `-2' is deprecated, use `-b 16' instead.
sox WARN sox: Option `-2' is deprecated, use `-b 16' instead.
sox WARN sox: Option `-s' is deprecated, use `-e signed-integer' instead.
[dvd-slideshow] This audio plays in slideshow from 0:0:0.000 to 0:0:5.000
[dvd-slideshow] Actual length of .raw file=0:0:5.000
[dvd-slideshow] ###############
[dvd-slideshow] Converting all track 1 audio files...
sox WARN sox: Option `-2' is deprecated, use `-b 16' instead.
sox WARN sox: Option `-s' is deprecated, use `-e signed-integer' instead.
soxi FAIL formats: can't open input file `-D': No such file or directory
(standard_in) 2: syntax error
(standard_in) 2: illegal character: I
(standard_in) 2: illegal character: :
(standard_in) 2: illegal character: '
(standard_in) 2: syntax error
(standard_in) 2: illegal character: '
(standard_in) 3: syntax error
(standard_in) 3: illegal character: :
(standard_in) 4: illegal character: S
(standard_in) 4: illegal character: R
(standard_in) 4: syntax error
(standard_in) 4: illegal character: :
(standard_in) 5: illegal character: P
(standard_in) 5: illegal character: :
(standard_in) 5: syntax error
(standard_in) 6: syntax error
(standard_in) 6: illegal character: :
(standard_in) 6: illegal character: :
(standard_in) 6: illegal character: :
(standard_in) 6: syntax error
(standard_in) 7: syntax error
(standard_in) 7: illegal character: S
(standard_in) 7: illegal character: :
(standard_in) 8: syntax error
(standard_in) 8: illegal character: R
(standard_in) 8: illegal character: :
(standard_in) 8: illegal character: M
(standard_in) 9: illegal character: S
(standard_in) 9: syntax error
(standard_in) 9: illegal character: :
(standard_in) 9: illegal character: S
(standard_in) 9: syntax error
(standard_in) 9: illegal character: I
(standard_in) 9: illegal character: P
(standard_in) 9: illegal character: M
[dvd-slideshow] Actual length of .raw file=
[dvd-slideshow] ERROR: no output .mp4 file found!
[dvd-slideshow] This usually happens when avconv screws up something
[dvd-slideshow] or one image is messed up and the resulting video can't be 
created
[dvd-slideshow]############################################################
[dvd-slideshow] Multiplexing audio and video...
[dvd-slideshow] Adding audio to .mp4 file
mv: cannot stat 
'/home/thep/tmp/dvd-slideshow/dvd-slideshow_temp_2068/video1.mp4': No such file 
or directory
[dvd-slideshow]############################################################
[dvd-slideshow] Non-DVD mode: not running spumux
[dvd-slideshow] total chapters=1
[dvd-slideshow] chapter markers at 0
[dvd-slideshow]############################################################
[dvd-slideshow] cleanup...
[dvd-slideshow] Total runtime was 2 seconds
[dvd-slideshow] More extensive logfile output is at:
[dvd-slideshow] /home/thep/tmp/dvd-slideshow/test.log
[dvd-slideshow] Done!

[dvd-slideshow] use one of the following comands to view your output:
[dvd-slideshow] totem "/home/thep/tmp/dvd-slideshow/test.mp4"
[dvd-slideshow] vlc "/home/thep/tmp/dvd-slideshow/test.mp4"
[dvd-slideshow] xine -g "/home/thep/tmp/dvd-slideshow/test.mp4"
[dvd-slideshow] mplayer "/home/thep/tmp/dvd-slideshow/test.mp4"
 
$
---8<---

And there is no test.mp4 output as the result.

The problems are:

1. [severe] Failure on soxi -D invokation:

soxi FAIL formats: can't open input file `-D': No such file or directory
(standard_in) 2: syntax error
(standard_in) 2: illegal character: I
(standard_in) 2: illegal character: :
(standard_in) 2: illegal character: '
...

Reordering 'soxi "$1" -D' to 'soxi -D "$1"' makes it work.

2. [trivial] Warnings on deprecated options:

sox WARN sox: Option `-2' is deprecated, use `-b 16' instead.
sox WARN sox: Option `-s' is deprecated, use `-e signed-integer' instead.

sox's changelog says the options were deprecated after the release of 14.4.0.
So, using the new options when sox >= 14.4.0 is found silences the warnings.

3. [severe] Failure on avconv, after above issues are fixed, due to
deprecated '-loop_input' option. From test.log:

[dvd-slideshow]############################################################
[dvd-slideshow] start_frame_number=0 start_time=0:0:0.000
[dvd-slideshow] Title 0:0:5.000
[dvd-slideshow]         Title=The Title
avconv version 10.1-6:10.1-1, Copyright (c) 2000-2014 the Libav developers
  built on May 11 2014 16:36:24 with gcc 4.8 (Debian 4.8.2-21)
Unrecognized option 'loop_input'.
Error splitting the argument list: Option not found
[dvd-slideshow] end_frame_number=150 end_time=0:0:5.000
[dvd-slideshow]############################################################

Replacing '-loop_input' option with '-loop 1' fixes the problem.

The attached patch summarizes the fixes for the above issues.

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.14-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=th_TH.UTF-8, LC_CTYPE=th_TH.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages dvd-slideshow depends on:
ii  dvdauthor         0.7.0-1.2
ii  gsfonts           1:8.11+urwcyr1.0.7~pre44-4.2
ii  imagemagick       8:6.7.7.10+dfsg-3
ii  libav-tools       6:10.1-1
ii  libavcodec-extra  6:10.1-1
ii  mjpegtools        1:2.1.0+debian-2.1
ii  netpbm            2:10.0-15+b2
ii  sox               14.4.1-4
ii  vorbis-tools      1.4.0-1

Versions of packages dvd-slideshow recommends:
ii  jhead    1:2.97-1
ii  lame     3.99.5+repack1-3
ii  twolame  0.3.13-1

dvd-slideshow suggests no packages.

-- no debconf information

--- dvd-slideshow.orig	2014-06-04 22:24:29.035226380 +0700
+++ dvd-slideshow	2014-06-05 12:53:58.311432798 +0700
@@ -913,11 +913,11 @@
 	# use avconv's -loop option to see if it's faster with a single image piped to the yuv4mpegpipe
 	if [ "$yuvfirstfile" -eq 1 ]; then
 		yuvfirstfile=0
-#		avconv -f image2 -loop_input -i "$1" -vframes "$myframes" -y -aspect $aspect_ratio -s "$dvd_width"x"$dvd_height" -r $framerate -an -pix_fmt yuv420p -f yuv4mpegpipe - 2>> "$avconv_err" >&9
-		avconv -f image2 -loop_input -i "$1" -vframes "$myframes" -y -s "$dvd_width"x"$dvd_height" -r $framerate -an -pix_fmt yuv420p -f yuv4mpegpipe - 2>> "$avconv_err" >&9
+#		avconv -f image2 -loop 1 -i "$1" -vframes "$myframes" -y -aspect $aspect_ratio -s "$dvd_width"x"$dvd_height" -r $framerate -an -pix_fmt yuv420p -f yuv4mpegpipe - 2>> "$avconv_err" >&9
+		avconv -f image2 -loop 1 -i "$1" -vframes "$myframes" -y -s "$dvd_width"x"$dvd_height" -r $framerate -an -pix_fmt yuv420p -f yuv4mpegpipe - 2>> "$avconv_err" >&9
 	else
-#		avconv -f image2 -loop_input -i "$1" -vframes "$myframes" -y -aspect $aspect_ratio -s "$dvd_width"x"$dvd_height" -r $framerate -an -pix_fmt yuv420p -f yuv4mpegpipe - 2>> "$avconv_err" | yuvstrip >&9
-		avconv -f image2 -loop_input -i "$1" -vframes "$myframes" -y -s "$dvd_width"x"$dvd_height" -r $framerate -an -pix_fmt yuv420p -f yuv4mpegpipe - 2>> "$avconv_err" | yuvstrip >&9
+#		avconv -f image2 -loop 1 -i "$1" -vframes "$myframes" -y -aspect $aspect_ratio -s "$dvd_width"x"$dvd_height" -r $framerate -an -pix_fmt yuv420p -f yuv4mpegpipe - 2>> "$avconv_err" | yuvstrip >&9
+		avconv -f image2 -loop 1 -i "$1" -vframes "$myframes" -y -s "$dvd_width"x"$dvd_height" -r $framerate -an -pix_fmt yuv420p -f yuv4mpegpipe - 2>> "$avconv_err" | yuvstrip >&9
 	fi
 else # use old method using ppmtoy4m pipe
 	if [ "$yuvfirstfile" -eq 1 ]; then
@@ -2522,7 +2522,7 @@
 	# wavlength $file 
 	# returns song length in ms
 	if [ "$soxi" == '1' ] ; then
-		soxi "$1" -D 1> "$tmpdir"/trash.txt
+		soxi -D "$1" 1> "$tmpdir"/trash.txt
 		song_length=`cat "$tmpdir"/trash.txt` 
 	else
 		sox "$1" $sox_nop stat 2> "$tmpdir"/trash.txt 
@@ -2535,7 +2535,7 @@
 
 rawlength ()
 {
-		sox -t raw -r $audio_sample_rate $sox_word -s -c 2 "$1" $sox_nop stat 2> "$tmpdir"/trash.txt 
+		sox -t raw -r $audio_sample_rate $sox_word $sox_int -c 2 "$1" $sox_nop stat 2> "$tmpdir"/trash.txt 
 		song_length=`cat "$tmpdir"/trash.txt | grep 'Length (seconds):' | awk -F: '{print $2}' | tr -d \[:blank:\]`
 		song_length=$( echo "scale=0; 1000 * $song_length" | bc | awk -F. '{printf ("%3.0f", $0)}' )
 		rm "$tmpdir"/trash.txt
@@ -3516,12 +3516,20 @@
 	progver=`sox -h 2>&1 | head -n 1 | awk '{ print $3 }'`
 	logecho "[dvd-slideshow] Found sox version $progver"
 	progver1="$( echo ${progver#v} | awk -F. '{print $1}' )"
+	progver2="$( echo ${progver#v} | awk -F. '{print $2}' )"
 	if [ $progver1 -lt 14 ] ; then  # use old sox commands:
 		sox_word='-w'
+		sox_int='-s'
 		sox_nop='-e'
 		soxi=0
-	else # use new commands ( > 14.0.0 )
+	elif [ $progver2 -lt 4 ]; then  # use new commands ( < 14.4.0 )
 		sox_word='-2'
+		sox_int='-s'
+		sox_nop='-n'
+		soxi=1
+	else # use new commands ( >= 14.4.0 )
+		sox_word='-b 16'
+		sox_int='-e signed-integer'
 		sox_nop='-n'
 		soxi=1
 	fi
@@ -6545,9 +6553,9 @@
 			elif [ "$file" == 'silence' ]; then
 				myecho "[dvd-slideshow] creating silent audio track... we will splice it later."
 				if [ "$audiosmp" -eq 1 ] ; then
-					sox -t raw -s $sox_word -c 2 -r $audio_sample_rate /dev/zero -t wav -c 2 -r $audio_sample_rate "$tmpdir/audio$track"_"$audio_index_padded.wav" trim 0 1 &
+					sox -t raw $sox_int $sox_word -c 2 -r $audio_sample_rate /dev/zero -t wav -c 2 -r $audio_sample_rate "$tmpdir/audio$track"_"$audio_index_padded.wav" trim 0 1 &
 				else
-					sox -t raw -s $sox_word -c 2 -r $audio_sample_rate /dev/zero -t wav -c 2 -r $audio_sample_rate "$tmpdir/audio$track"_"$audio_index_padded.wav" trim 0 1
+					sox -t raw $sox_int $sox_word -c 2 -r $audio_sample_rate /dev/zero -t wav -c 2 -r $audio_sample_rate "$tmpdir/audio$track"_"$audio_index_padded.wav" trim 0 1
 				fi
 			else
 				myecho "[dvd-slideshow] ERROR:  Unknown audio file format. Must be mp3, ogg, mp4/aac, wav, or silence"
@@ -6845,7 +6853,7 @@
 		myecho "[dvd-slideshow] fade_in_time=$fade_in_hms fade_out_time=$fade_out_hms"
 		total_audio_length="$(( $total_audio_length + $song_length ))"
 		myecho "[dvd-slideshow] total_audio_length=`hms $total_audio_length`"
-		sox -v 0.95 "$tmpdir/audio$track"_"$i_padded.wav" $sox_word -s -c 2 -r $audio_sample_rate "$tmpdir/audio1_$i_padded.raw" fade t "$fade_in_hms" "$song_length_hms" "$fade_out_hms"
+		sox -v 0.95 "$tmpdir/audio$track"_"$i_padded.wav" $sox_word $sox_int -c 2 -r $audio_sample_rate "$tmpdir/audio1_$i_padded.raw" fade t "$fade_in_hms" "$song_length_hms" "$fade_out_hms"
 		let i=$i+1
 		myecho "[dvd-slideshow] ###############"
 	done
@@ -6855,11 +6863,11 @@
 		# video is longer than audio. need to add silence to end.
 		thetime_hms=`hms $(( $end_time - $total_audio_length + 1000 ))` #plus 10 so sox actually crops.
 		myecho "[dvd-slideshow] Buffering end of audio file with silence for $thetime_hms"
-		sox -t raw -s $sox_word -c 2 -r $audio_sample_rate /dev/zero $sox_word -s -c 2 -r $audio_sample_rate "$tmpdir/audio1_$i_padded.raw" trim 0 "$thetime_hms"
+		sox -t raw $sox_int $sox_word -c 2 -r $audio_sample_rate /dev/zero $sox_word $sox_int -c 2 -r $audio_sample_rate "$tmpdir/audio1_$i_padded.raw" trim 0 "$thetime_hms"
 	fi
 	
 	## cat all the audio files together: 
-	cat "$tmpdir"/audio1_????.raw | sox -t raw $sox_word -s -c 2 -r $audio_sample_rate - "$tmpdir/audio1.wav"
+	cat "$tmpdir"/audio1_????.raw | sox -t raw $sox_word $sox_int -c 2 -r $audio_sample_rate - "$tmpdir/audio1.wav"
 	## fade out at end of video:
 	sox "$tmpdir/audio1.wav" "$tmpdir/audio_out.wav" fade t 0 "$end_hms" "$fade_out_hms"
 	mv "$tmpdir/audio_out.wav" "$tmpdir/audio1.wav"
@@ -6951,7 +6959,7 @@
 			song_end_hms=`hms $song_end_ms`
 			song_start_hms="0"  # cannot modify starting point yet...
 			myecho "[dvd-slideshow] Creating silence audio file for $song_end_hms"
-			sox -t raw -s $sox_word -c 1 -r $audio_sample_rate /dev/zero $sox_word -s -c 2 -r $audio_sample_rate "$tmpdir"/audio1_$i_padded.raw trim "0" "$song_end_hms"
+			sox -t raw $sox_int $sox_word -c 1 -r $audio_sample_rate /dev/zero $sox_word $sox_int -c 2 -r $audio_sample_rate "$tmpdir"/audio1_$i_padded.raw trim "0" "$song_end_hms"
 		else
 			## file should only be wav format at this point since it was decoded before
 			## all audio files are of the format "$tmpdir"/audio_1.wav
@@ -7046,13 +7054,13 @@
 				# fade only to the end of song length now, because we may have to add silence:
 				# We should probably eventually add the silence first, and then chop the song?
 				if [ "$fade_in_time" -eq 0 ] && [ "$fade_out_time" -eq 0 ] ; then
-					sox -v $volume "$tmpdir/audio1_$i_padded.wav" $sox_word -s -c 2 -r $audio_sample_rate "$tmpdir/audio1_$i_padded.raw"
+					sox -v $volume "$tmpdir/audio1_$i_padded.wav" $sox_word $sox_int -c 2 -r $audio_sample_rate "$tmpdir/audio1_$i_padded.raw"
 				else  # fade in or out
-					sox -v $volume "$tmpdir/audio1_$i_padded.wav" $sox_word -s -c 2 -r $audio_sample_rate "$tmpdir/audio1_$i_padded.raw" fade t "$fade_in_hms" "$song_length_hms" "$fade_out_hms"
+					sox -v $volume "$tmpdir/audio1_$i_padded.wav" $sox_word $sox_int -c 2 -r $audio_sample_rate "$tmpdir/audio1_$i_padded.raw" fade t "$fade_in_hms" "$song_length_hms" "$fade_out_hms"
 				fi
 				thetime_hms=`hms $(( $song_end_ms - $song_length_ms ))` 
 				myecho "[dvd-slideshow] Adding $thetime_hms of silence to end of original audio file"
-				sox -t raw -s $sox_word -c 2 -r $audio_sample_rate /dev/zero $sox_word -s -c 2 -r $audio_sample_rate "$tmpdir/silence.raw" trim 0 "$thetime_hms"
+				sox -t raw $sox_int $sox_word -c 2 -r $audio_sample_rate /dev/zero $sox_word $sox_int -c 2 -r $audio_sample_rate "$tmpdir/silence.raw" trim 0 "$thetime_hms"
 				cat "$tmpdir/audio1_$i_padded.raw" "$tmpdir/silence.raw" > "$tmpdir/audio.raw" 
 				mv "$tmpdir/audio.raw" "$tmpdir/audio1_$i_padded.raw"
 				rm "$tmpdir"/silence.raw
@@ -7067,13 +7075,13 @@
 #				echo "song_length_ms=$song_length_ms song_end_ms=$song_end_ms fade_in_time=$fade_in_time fade_out_time=$fade_out_time"
 				if [ "$song_length_ms" -ne "$song_end_ms"  ] && [ "$fade_in_time" -eq 0 ] && [ "$fade_out_time" -eq 0 ] ; then
 #					echo "cropping"
-					sox -v $volume "$tmpdir/audio1_$i_padded.wav" $sox_word -s -c 2 -r $audio_sample_rate "$tmpdir/audio1_$i_padded.raw" trim 0 "$song_end_hms"
+					sox -v $volume "$tmpdir/audio1_$i_padded.wav" $sox_word $sox_int -c 2 -r $audio_sample_rate "$tmpdir/audio1_$i_padded.raw" trim 0 "$song_end_hms"
 				elif [ "$fade_out_time" -ne 0 ] || [ "$fade_in_time" -ne 0 ] ; then
 #					echo "fading"
-					sox -v $volume "$tmpdir/audio1_$i_padded.wav" $sox_word -s -c 2 -r $audio_sample_rate "$tmpdir/audio1_$i_padded.raw" fade t "$fade_in_hms" "$song_end_hms" "$fade_out_hms"
+					sox -v $volume "$tmpdir/audio1_$i_padded.wav" $sox_word $sox_int -c 2 -r $audio_sample_rate "$tmpdir/audio1_$i_padded.raw" fade t "$fade_in_hms" "$song_end_hms" "$fade_out_hms"
 				else
 #					echo "converting"
-					sox -v $volume "$tmpdir/audio1_$i_padded.wav" $sox_word -s -c 2 -r $audio_sample_rate "$tmpdir/audio1_$i_padded.raw" 
+					sox -v $volume "$tmpdir/audio1_$i_padded.wav" $sox_word $sox_int -c 2 -r $audio_sample_rate "$tmpdir/audio1_$i_padded.raw" 
 				fi
 			fi
 			# now, audio should span to the end mark
@@ -7082,7 +7090,7 @@
 			## buffer beginning with silence:
 			thetime_hms=`hms "${audio1_start[$i]}"`
 			myecho "[dvd-slideshow] Adding $thetime_hms to beginning of audio file"
-			sox -t raw -s $sox_word -c 2 -r $audio_sample_rate /dev/zero $sox_word -s -c 2 -r $audio_sample_rate "$tmpdir/silence.raw" trim 0 "$thetime_hms"
+			sox -t raw $sox_int $sox_word -c 2 -r $audio_sample_rate /dev/zero $sox_word $sox_int -c 2 -r $audio_sample_rate "$tmpdir/silence.raw" trim 0 "$thetime_hms"
 			cat "$tmpdir"/silence.raw "$tmpdir/audio1_$i_padded.raw" > "$tmpdir/audio.raw" 
 			mv "$tmpdir/audio.raw" "$tmpdir/audio1_$i_padded.raw"
 			rm "$tmpdir"/silence.raw
@@ -7101,7 +7109,7 @@
 		myecho "[dvd-slideshow] Creating ac3 audio..."
 		checkforprog avconv
 		rm -f "$tmpdir/audio1.ac3"
-		cat "$tmpdir"/audio1_????.raw | sox -t raw $sox_word -s -c 2 -r $audio_sample_rate - -t wav - 2> /dev/null >"$tmpdir/audio1.wav"
+		cat "$tmpdir"/audio1_????.raw | sox -t raw $sox_word $sox_int -c 2 -r $audio_sample_rate - -t wav - 2> /dev/null >"$tmpdir/audio1.wav"
 		if [ $? -ne 0 ] ; then
 			## sox errored
 			myecho "[dvd-slideshow] ERROR during sox execution!"
@@ -7118,7 +7126,7 @@
 		fi
 	else
 		myecho "[dvd-slideshow] Converting all track 1 audio files..."
-		cat "$tmpdir"/audio1_????.raw | sox -t raw $sox_word -s -c 2 -r $audio_sample_rate - "$tmpdir/audio1.wav"
+		cat "$tmpdir"/audio1_????.raw | sox -t raw $sox_word $sox_int -c 2 -r $audio_sample_rate - "$tmpdir/audio1.wav"
 		if [ "$debug" -ge 1 ] ; then
 			length=`wavlength "$tmpdir/audio1.wav"`
 			myecho "[dvd-slideshow] Actual length of .raw file=`hms $length`"
@@ -7184,7 +7192,7 @@
 			song_end_hms=`hms $song_end_ms`
 			song_start_hms="0"  # cannot modify starting point yet...
 			myecho "[dvd-slideshow] Creating silence audio file for $song_end_hms"
-			sox -t raw -s $sox_word -c 2 -r $audio_sample_rate /dev/zero $sox_word -s -c 2 -r $audio_sample_rate "$tmpdir"/audio2_$i_padded.raw trim "0" "$song_end_hms"
+			sox -t raw $sox_int $sox_word -c 2 -r $audio_sample_rate /dev/zero $sox_word $sox_int -c 2 -r $audio_sample_rate "$tmpdir"/audio2_$i_padded.raw trim "0" "$song_end_hms"
 		else # not silence
 			## file should only be wav format at this point since it was decoded before
 			## all audio files are of the format "$tmpdir"/audio_2.wav
@@ -7283,19 +7291,19 @@
 				# fade only to the end of song length now, because we may have to add silence:
 				# We should probably eventually add the silence first, and then chop the song?
 				if [ "$fade_in_time" -eq 0 ] && [ "$fade_out_time" -eq 0 ] ; then
-					sox -v $volume "$tmpdir/audio2_$i_padded.wav" $sox_word -s -c 2 -r $audio_sample_rate "$tmpdir/audio2_$i_padded.raw"
+					sox -v $volume "$tmpdir/audio2_$i_padded.wav" $sox_word $sox_int -c 2 -r $audio_sample_rate "$tmpdir/audio2_$i_padded.raw"
 				else # one of the fades is nonzero:
-					sox -v $volume "$tmpdir/audio2_$i_padded.wav" $sox_word -s -c 2 -r $audio_sample_rate "$tmpdir/audio2_$i_padded.raw" fade t "$fade_in_hms" "$song_length_hms" "$fade_out_hms"
+					sox -v $volume "$tmpdir/audio2_$i_padded.wav" $sox_word $sox_int -c 2 -r $audio_sample_rate "$tmpdir/audio2_$i_padded.raw" fade t "$fade_in_hms" "$song_length_hms" "$fade_out_hms"
 				fi
 				thetime_hms=`hms $(( $song_end_ms - $song_length_ms + 1000 ))` #plus 1s so sox actually crops.
 				thetime2_hms=`hms $(( $song_end_ms - $song_length_ms ))` 
 				myecho "[dvd-slideshow] Adding $thetime2_hms of silence to end of original audio file"
-				sox -t raw -s $sox_word -c 2 -r $audio_sample_rate /dev/zero $sox_word -s -c 2 -r $audio_sample_rate "$tmpdir/silence.raw" trim 0 "$thetime_hms"
+				sox -t raw $sox_int $sox_word -c 2 -r $audio_sample_rate /dev/zero $sox_word $sox_int -c 2 -r $audio_sample_rate "$tmpdir/silence.raw" trim 0 "$thetime_hms"
 				cat "$tmpdir/audio2_$i_padded.raw" "$tmpdir/silence.raw" > "$tmpdir/audio.raw" 
 				mv "$tmpdir/audio.raw" "$tmpdir/audio2_$i_padded.raw"
 				# hopefully there won't be many times where the audio needs to be buffered 
 				# at the end, so we'll add one extra step to make the coding easier:
-				sox -t raw -s $sox_word -c 2 -r $audio_sample_rate "$tmpdir/audio2_$i_padded.raw" "$tmpdir/audio2_$i_padded.wav"
+				sox -t raw $sox_int $sox_word -c 2 -r $audio_sample_rate "$tmpdir/audio2_$i_padded.raw" "$tmpdir/audio2_$i_padded.wav"
 				rm "$tmpdir"/silence.raw
 			fi
 			if [ "$debug" -ge 2 ] ; then
@@ -7307,20 +7315,20 @@
 			fi
 			if [ "$song_length_ms" -ne "$song_end_ms"  ] && [ "$fade_in_time" -eq 0 ] && [ "$fade_out_time" -eq 0 ] ; then
 #				echo "cropping"
-				sox -v $volume "$tmpdir/audio2_$i_padded.wav" $sox_word -s -c 2 -r $audio_sample_rate "$tmpdir/audio2_$i_padded.raw" trim 0 "$song_end_hms"
+				sox -v $volume "$tmpdir/audio2_$i_padded.wav" $sox_word $sox_int -c 2 -r $audio_sample_rate "$tmpdir/audio2_$i_padded.raw" trim 0 "$song_end_hms"
 			elif [ "$fade_out_time" -ne 0 ] || [ "$fade_in_time" -ne 0 ] ; then
 #				echo "fading"
-				sox -v $volume "$tmpdir/audio2_$i_padded.wav" $sox_word -s -c 2 -r $audio_sample_rate "$tmpdir/audio2_$i_padded.raw" fade t "$fade_in_hms" "$song_end_hms" "$fade_out_hms"
+				sox -v $volume "$tmpdir/audio2_$i_padded.wav" $sox_word $sox_int -c 2 -r $audio_sample_rate "$tmpdir/audio2_$i_padded.raw" fade t "$fade_in_hms" "$song_end_hms" "$fade_out_hms"
 			else
 #				echo "converting"
-				sox -v $volume "$tmpdir/audio2_$i_padded.wav" $sox_word -s -c 2 -r $audio_sample_rate "$tmpdir/audio2_$i_padded.raw" 
+				sox -v $volume "$tmpdir/audio2_$i_padded.wav" $sox_word $sox_int -c 2 -r $audio_sample_rate "$tmpdir/audio2_$i_padded.raw" 
 			fi
 		fi  # end of if silence or not
 		if [ $i -eq 0 ] && [ "${audio2_start[$i]}" -ne 0 ] ; then
 			## buffer beginning with silence:
 			thetime_hms=`hms "${audio2_start[$i]}"`
 			myecho "[dvd-slideshow] Adding $thetime_hms to beginning of audio file"
-			sox -t raw -s $sox_word -c 2 -r $audio_sample_rate /dev/zero $sox_word -s -c 2 -r $audio_sample_rate "$tmpdir/silence.raw" trim 0 "$thetime_hms"
+			sox -t raw $sox_int $sox_word -c 2 -r $audio_sample_rate /dev/zero $sox_word $sox_int -c 2 -r $audio_sample_rate "$tmpdir/silence.raw" trim 0 "$thetime_hms"
 			cat "$tmpdir"/silence.raw "$tmpdir/audio2_$i_padded.raw" > "$tmpdir/audio.raw" 
 			mv "$tmpdir/audio.raw" "$tmpdir/audio2_$i_padded.raw"
 			rm "$tmpdir"/silence.raw
@@ -7337,7 +7345,7 @@
 	myecho "[dvd-slideshow] Concatenating all track 2 audio files..."
 	## cat all the audio files together: 
 #	find "$tmpdir" -name audio2_????.raw -print0 | xargs -0 sox -t raw $sox_word -s -c 2 -r $audio_sample_rate - "$tmpdir/audio2.wav"
-	cat "$tmpdir"/audio2_????.raw | sox -t raw $sox_word -s -c 2 -r $audio_sample_rate - "$tmpdir/audio2.wav"
+	cat "$tmpdir"/audio2_????.raw | sox -t raw $sox_word $sox_int -c 2 -r $audio_sample_rate - "$tmpdir/audio2.wav"
 	if [ "$debug" -ge 1 ] ; then
 		length=`wavlength "$tmpdir/audio2.wav"`
 		myecho "[dvd-slideshow] Actual length of .raw file=`hms $length`"

Reply via email to