HydrogenAudio

Hydrogenaudio Forum => General Audio => Topic started by: ismanpa on 2018-04-02 07:36:53

Title: SoX command to batch insert
Post by: ismanpa on 2018-04-02 07:36:53
Hello,
Is there a single SoX command to batch insert a short audio into a whole directory of music/album files?

I do not know anything about SoX.  It is installed on my Linux MInt.

Thank you!

Title: Re: SoX command to batch insert
Post by: lozenge on 2018-04-02 13:43:34
Sox can be used to record, synthesize or edit audio files, the exact invocation of the command you'd use depends on precisely what you want to do. It can write it's output to any available file-system with appropriate permissions.

The way you ask about batch inserting an audio file in to a directory (presumably several directories) seems more like a task for a file manager or  script to manipulate the file system,- without any need for an audio processing tool like sox, which would be more appropriate for say batch trimming the silence from the end of a file, or even concatenating additional audio.

e.g. find all directories  beneath  ~/Music/ripped/  and recursively copy "irippedthiscd.mp3" to each of them -- seems like what you asked for but needn't involve anything that actually manipulates audio, except perhaps creating the additional file (ideally once as a separate task, before starting batch processing). Could be done in a one-liner with find and exec, or a shell loop that gets as complex as you like.

versus

find every WAV file, normalize to -6dBFS, and trim off the last 2 seconds of each, which would be almost text-book Sox usage

Certainly it's possible to combine the two.  If you could explain clearly precisely what you want to do (with examples if possible) you're more likely to get a more helpful response.