Skip to main content

Topic: flac from 24bit 96kHz to 16bit 44kHz in batch (Read 7051 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • ferossan
  • [*]
flac from 24bit 96kHz to 16bit 44kHz in batch
Hi all

Already I'm using sox to resample some 24bit 96kHz files to 16bit 44kHz:
sox -S OriginalFile.flac -r 44100 -b 16 NewFile.flac

My problem is I have to do it each file one by one.
Is there any way to apply that command to a batch script and be able to resample all files in a given folder and put the new ones in another folder?
Can anyone give me an script example? (or any other advice to batch process the command)

I'm open to any other solution as long works under Linux.

Thanks a lot.

  • tot
  • [*][*]
flac from 24bit 96kHz to 16bit 44kHz in batch
Reply #1
for flac in *.flac; do sox -S "${flac}" -r 44100 -b 16 new/"${flac}"; done

would process all files matching *.flac in the current folder and put the new files into "new" subfolder (you'll need to create it first).
Teemu

  • ferossan
  • [*]
flac from 24bit 96kHz to 16bit 44kHz in batch
Reply #2
for flac in *.flac; do sox -S "${flac}" -r 44100 -b 16 new/"${flac}"; done

would process all files matching *.flac in the current folder and put the new files into "new" subfolder (you'll need to create it first).


Wonderful!!! Works great!!
Thanks a lot

  • danc6433
  • [*]
flac from 24bit 96kHz to 16bit 44kHz in batch
Reply #3
damn....that is amazing. how the hell do you know that!


  • mjb2006
  • [*][*][*][*][*]
flac from 24bit 96kHz to 16bit 44kHz in batch
Reply #4
damn....that is amazing. how the hell do you know that!


I hate to say RTFM, but...
For Windows command shell users, the command 'help' is your friend. Specifically, 'help for'.
For Unix, 'man sh' or read one of the many books & tutorials.

  • HotshotGG
  • [*][*][*][*][*]
flac from 24bit 96kHz to 16bit 44kHz in batch
Reply #5
Quote
I hate to say RTFM, but..


Something many people do not do....  . My favorite phrase these days though.
College student/IT Assistant

  • AshenTech
  • [*][*]
flac from 24bit 96kHz to 16bit 44kHz in batch
Reply #6
im so glad I own dbpoweramp no need for commandline mode