All,
I've got a script that runs the script below 10 times (it reads a 4
channel file, passes it through a LADSPA plugin, then writes 4 mono
files).
I've just noticed that my hard drive is getting fuller and fuller,
even though I've been erasing the output of the script.
I did a search for recnelty modified files and found that /tmp is
filling up with very large files named snd_xxx_0.snd
Have I done something wrong in the script below? (I _do_close the
original file). I'm running SND version 7.9 (until I fix the compile
errors posted in the previous email).
regards,
Etienne
-----------------------------------------------------------------
#!/usr/bin/snd -b
!#
(use-modules (ice-9 format))
; set some global variables
(set! (sinc-width) 100); set the sync width to very high to get the
smaple rate conversion as accurate as possible
(if (not (= (length (script-args)) 3)) ;
(display "usage: decode_to_square.sh file-name")
(begin
(let ((name (list-ref (script-args) (+ (script-arg) 1)) ))
(let ((index (open-sound name)))
(display (format #f "header is ~a (or
~a) \n" (header-type index) (mus-header-type-name (header-type index))
))
(display (format #f "data-format is ~a
(or ~a) \n" (data-format index) (mus-data-format-name (data-format
index) ) ))
(display (format #f "Resampling from
~D to 44100 \n" (srate index)))
; resample
(src-sound (/ (srate index) 44100) 1.0 index)
; apply LADSPA plugin that converts to
4 speaker feeds in a square
(apply-ladspa (list
(make-sample-reader 0 0 0) ; W
(make-sample-reader 0 0 1) ; X
(make-sample-reader 0 0 2) ; Y
(make-sample-reader 0 0 3)) ; Z
(list "ambis1"
"Ambisonics-square-decoder" 0 1 1.4138 2 380 2.7)
(mus-sound-frames name)
"ambisonic file")
; now convert the 4 channels into 4
mono wav files, and write to disk
(do ((i 0 (1+ i)))
((= i 4))
(display (format #f "writing
channel ~D\n" i))
(save-sound-as (format #f "~a.~a" name
(case i
((0) "LFront.wav")
((1) "RFront.wav")
((2) "RSurround.wav")
((3) "LSurround.wav")
(else "lost")
)
)
index
:header-type
mus-riff ; (value= 3) RIFF header (for Microsoft WAVE)
:data-format
mus-l24int ; (value= 16) 24 Bit little endian int
:srate 44100 ;
the sound is already resampled, so lets set the appropriate file
header
:channel i)
)
(close-sound index)
)
)
)
)
(exit)
_______________________________________________
Cmdist mailing list
[email protected]
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist