From a590ad25dc2fa20301f47b7b6c84e5f176e36db2 Mon Sep 17 00:00:00 2001 From: Alexander Nguyen <alexander.nguyen@stud.hfm-karlsruhe.de> Date: Sat, 25 Jan 2025 21:48:25 +0100 Subject: [PATCH] Update --- sources/sox-process.lisp | 28 ++++++++++++++++++++-------- 1 files changed, 20 insertions(+), 8 deletions(-) diff --git a/sources/sox-process.lisp b/sources/sox-process.lisp index 4f54088..da3a27b 100644 --- a/sources/sox-process.lisp +++ b/sources/sox-process.lisp @@ -183,13 +183,22 @@ (defmethod! sox-process ((sox-input sox-hoaencode) (sox-effect string) &key output filetype samplerate bitdepth recursive batch-mode) (if (probe-file *sox-path*) (progn + (when + (not (listp (sound sox-input))) + (om-message-abort "sound must be a list.") + ) + (when + (not + (or + (subtypep (type-of (positions sox-input)) '3dc) + (and (subtypep (type-of (positions sox-input)) 'list) (> (length (positions sox-input)) 0) (subtypep (type-of (first (positions sox-input))) 'list) (> (length (first (positions sox-input))) 1))) + ) + (om-message-abort "positions must be of type 3dc, or a list of lists.") + ) (let* ( (sound - (if (> (length (positions sox-input)) (length (list! (sound sox-input)))) - (repeat-n (first (list! (sound sox-input))) (length (positions sox-input))) - (sound sox-input) - ) + (sound sox-input) ) (positions-ae (sox-hoaencode-auto-convert-positions (positions sox-input)) @@ -201,8 +210,8 @@ ) (let* ( - (outfile (create-path nil output filetype)) (filenames (loop for soundfile in sound collect (namestring soundfile))) + (outfile (create-path nil output filetype)) ) (setf str (format nil " ~s ~a" (namestring *sox-path*) *sox-options*)) (if (= (length filenames) 1) @@ -262,9 +271,12 @@ ) (setf str (cond - ((equal output "realtime") (sox-samplebits (string+ str " -q ") bitdepth samplerate *sox-audio-device*)) - ((equal output "pipe") (sox-samplebits str bitdepth samplerate "-p")) - (t (sox-samplebits str bitdepth samplerate outfile)) + ((equal output "realtime") + (sox-samplebits (string+ str " -q ") bitdepth samplerate *sox-audio-device*)) + ((equal output "pipe") + (sox-samplebits str bitdepth samplerate "-p")) + (t + (sox-samplebits str bitdepth samplerate outfile)) ) ) (setf str (string+ str sox-effect)) -- Gitblit v1.9.1