Author Topic: Make functions available in converters command line switches  (Read 1852 times)

Hyalin

  • Newbie
  • *
  • Posts: 15
Hi, I tried to use functions inside command line converters without success. Would it be hard to allow their use there ?

What I want to do is to on-the-fly convert from FLAC 96/24 (library) to FLAC 48/24 (mobile) as well as from FLAC 88.2/24 (library) to FLAC 44.1/24 (mobile). My mobile use Apt-X HD codec up to 48/24 so this conversion would allow me to save space. Also, I want to avoid 96 kHz to 44.1 kHz or 88.2 kHz to 48 kHz so I have to make the conversion regarding the sample rate of the original files.

I use SoX to do the resampling, by replacing command line flac.exe :
sox.exe - -r 44100 -b 24 [outputfile] : works fine
sox.exe - -r 48000 -b 24 [outputfile] : works fine

What I would like to do is something like :

sox.exe - -r $If($Contains(<sample rate>,88)="T","44100","48000") -b 24 [outputfile]

but it fails... (Actually I suppose <sample rate> is the right tag in english language)

Thanks
Last Edit: May 04, 2018, 09:04:02 PM by Hyalin

jippijip

  • Jr. Member
  • **
  • Posts: 47
I'm not sure whether this works, but I have managed to access SoX features from within Musicbee. Have you tried putting your command statement in a virtual tag, and then put feed that into the converter?

Hyalin

  • Newbie
  • *
  • Posts: 15
No I didn't try. Not sure to understand what you mean but I will have a look at virtual tags.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34368
i will look into supporting functions on command line parameters

edit:
this should work
http://musicbee.niblseed.com/V3_2/MusicBee32_Patched.zip
unzip and replace the existing musicbee files
Last Edit: May 03, 2018, 08:57:00 PM by Steven

Hyalin

  • Newbie
  • *
  • Posts: 15
It works P.E.R.F.E.C.T.L.Y fine !!!

EDIT1: not 100% perfect
the temporary files created are not deleted afterwards : syncing a 64 Gb card rapidly fills my 6 Gb ramdisk and stops.
(when syncing MP3 files in another location, temp files are created and deleted on-the-fly  at they should).


EDIT2: my bad, the copying on the card is far too slow compared to the encoding. The files are correctly deleted. I have to reduce the number of parallel encoding

Just a subsidiary question : what is the processing behind the "resample at 44.1K" option in file converters ? (sorry I do not use the english version so maybe the text is not exactly this one). As I said I use SoX myself, but I had to install it.

Maybe I can make a few more suggestions regarding conversions :

- Using on-the-fly conversion to my mobile, I would like to leave untouched original 48/24 and 44.1/24 standard FLAC, whereas 96/24 and 88.2/24 HD FLAC are converted to 48/24 and 44.1/24 FLAC respectively.
I know there is an option to convert only files above a given rate, but I found that the rate of two different FLAC files with identical sample rate/bit depth can vary dramatically (regarding the audio content) so I cannot find a fixed rate limit above which I find all HD FLAC and below which I find all standard FLAC. So maybe the "rate" option is not the best one and could be replaced with sample rate/bit depth options.

- make functions also available in the executable line (and not only in the switches), and also give the possibility to bypass the execution of the command line with respect to a given function : this would cancel the previous suggestion.

- allow custom options for each encoder in encoding parameters.

Thanks for this great piece of software.
Last Edit: May 05, 2018, 12:00:49 AM by Hyalin