Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: flac from 24bit 96kHz to 16bit 44kHz in batch (Read 9507 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

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.

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

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

flac from 24bit 96kHz to 16bit 44kHz in batch

Reply #3
damn....that is amazing. how the hell do you know that!


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.

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.
budding I.T professional

 

flac from 24bit 96kHz to 16bit 44kHz in batch

Reply #6
im so glad I own dbpoweramp no need for commandline mode