-1

I'm trying to do some transformation to some audio data using the sox command. I'm filtering all of my 'wav' files with the following command:

 find . -name '*.wav'

Now, I would like to apply the sox command to all of the returned files, something like this:

find . -name '*.wav' | sox name-of-the-file-returned store-file-with-the-same-name

Does anyone know how would I take the returned path from the first command and give it twice as arguments to the second command, since I'm trying to run the following command:

sox file-name.wav file-name.wav

Thank you in advance!

jww
  • 97,681
  • 90
  • 411
  • 885
UrmLmn
  • 1,099
  • 2
  • 16
  • 28
  • 1
    Possible duplicate of [find -exec a shell function in Linux?](https://stackoverflow.com/q/4321456/608639), [find -exec with multiple commands](https://stackoverflow.com/q/5119946/608639), [Bash script to execute command on all files in a directory](https://stackoverflow.com/q/10523415/608639), etc. – jww Apr 29 '18 at 21:33

1 Answers1

1

You can do something like

find . -name '*.wav' | xargs -I@ bash -c "sox @ @"