Home Computer Audio Asylum

Music servers and other computer based digital audio technologies.

New Version of Cplayrun batch file plays MP3 and APE files using Cplay

NEW VERSION: Now plays all four formats supported by Recursive Cue Creator, using Cplay, by automatically converting APE and MP3 files to WAV in the Windows Temporary Folder and automatically editing the CUE file to match, and then starting Cplay with that cue file. (This feature requires a .vbs file, which is included in the download link. It also requires the free Monkey's Audio program to convert APE files, and/or the free Lame program to convert MP3 files, and links for those are at the bottom of this same post.)

This will work without cue files, but then only with one file at a time, as cue files continue to be the "playlist" of cplay. (It also supports Shorten SHN files, but those are not currently supported by Recursive Cue Creator, so any cue file would be supplied on your own.)

On my PC, conversion to WAV takes about one second per minute of audio files, YMMV.

For those who are unfamiliar with Cplayrun batch file, the following is the entirety of the earlier post explaining it:

WHAT: A Windows Batch File that integrates cPlay for flac and wave files, with another player (foobar2000 v0.8.3) for all other music files, and provides automated rate switching for cPlay:

MOTIVATION: Recently I discovered that a DAC that 1) generates its own timing, 2) generates its own regulated power, and 3) isolates the digital audio chain from the analog chain, removes most of the defects of digital audio that makes it sound worse than analog audio. (The HRT Music Streamer II at US$150 does all three things, but there are others as well, but perhaps not as inexpensive.)

I then became interested in comparing the sound of music playing software, using this DAC, and found that the smaller and lighter the program, the better it sounded (in other words, the least distortion it applied to the original audio). The free program "cPlay" - developed in this very Forum - continues to produce the best sound quality of any player I have tried. (Amongst the others, currently MusicBee is notable for combining stability with a lot of fun features, such as lyrics scrolling in sync, album art, display of web information on the artist, etc - but it seems those features come at a sound quality cost.)

My music playback PC is also my living room video PC, so it runs Vista, and so I have been unable to run the "cmp" system that replaces the Window shell, since it does not work with Vista. However, I did build that PC from scratch using "quiet home theater PC" principles that mirror the ones in the "cmp2" hardware system. And I had already disabled all unnecessary services and software for better video playback, so that also mirrors some of the cmp principles as well.

DETAILS: There are two difficulties with using cPlay that I have sought to overcome:

1) It has a fixed output sample rate. cPlay was written when virtually all music was 44.1 khz and so upsampling to a much higher rate had some benefits. However, now we have hdtracks providing 88.2, 96 and 176.4 files. My DAC is limited to 96khz, and upsampling from 88.2 to 96 definitely sounds worse than just leaving it as 88.2 khz. So, I need a system to set the sample rate based on the file's rate.

Fortunately, Bibo01 posted a batch file to this Forum a few weeks ago that changes the cPlay .ini file's RATE setting based on the user's keyboard input to a prompt. I modified that batch file to instead look for a text file in the same folder - "44.txt" to use 44.1 khz, "48.txt" to use 48 khz, "88.txt" to use 88.2 khz, "96.txt" to use 96 khz, "176.txt" to use 176.4 khz, and "192.txt" to use 192 khz. (The files can be empty, zero length, text files.) Since you can right-click in a folder (using Windows Explorer or a replacement) and select New File or New Text Document and name it, then you specify the output sample rate very quickly and easily. And this can be more sophisticated than "use the file's sample rate" if, like me, you have files with rates greater than the DAC's limit. So "88.txt" in a folder with 176.4 khz files will downsample in a clean way by tossing out every other sample, rather than intensive computation to go from 176.4 to 96.

2) cPlay only plays WAV and FLAC files. I have many lossless audio files in other formats, including APE, SHN, ALAC and WV, and also some lossey files in MP3 and WMA format. If you start cPlay and try to use it to play music, you find that sometimes you want to hear music and it is in APE or some other format unsupported by cPlay and you have to close cPlay and then find the music again to play it with another player.

So, I wanted a system that will play all my music files, and use cPlay for all WAV and FLAC files, and another player for all the other files. In my personal testing, I found foobar2000 0.8.3 to be the best sounding player outside of cPlay - better sounding than the current foobar2000. It starts up instantly, showing that it is very small and light (smaller than current foobar which has added a lot of code over the six years).

HOW TO USE: The simplest way to accomplish my goal, was to use a file explorer, and associate all audio files with foobar2000 0.8.3 and then associate WAV and FLAC files with the batch file mentioned above that sets the sample rate. In order to have the most minimal setup for best sound quality, I chose a popular small, light, free file explorer and included a line in the batch file to kill its process before playback. The batch file also runs cPlay in realtime priority using the same lines from cPlay's included batch file.

However, that only allows you to play one FLAC or WAV file at a time. In order to play a whole album, you also need to associate CUE files with the batch file. You can then use Alan Jordan's Recursive Cue Creator to create CUE files for every folder in your music library (available from alanjordan.org). (By the way, you don't need CUE files to be associated with foobar, because if you click on a full-album APE file, it will look for a CUE file in the folder for the track information.)

A link for the cplayrun.bat batch file is at the bottom of this post. The provided version includes code that supports rates up to 192, but is intentionally limited to 96 - since that is my DAC's limit, and may be yours. If you have a 192 DAC, open the batch file in a text editor, and there are comments explaining the lines to remove to allow it go all the way up to 192.

The current version of the batch file in this cPlay thread is the second version 0.2.0, which includes two new additions: (1) added support to automatically use cPlay for cue files that it supports, and foobar2000 for all other cue files, and (2) support to add a folder context menu entry that will choose cPlay for folders that can be played by cPlay, and foobar for all other folders. (For those who cannot figure out to add that support to the registry, let me know and I'll provide a .reg file to do it.)

Also, the batch file should be put in cplay's folder, and it is hard coded in the batch file to be:

C:\Program Files\cics Play

If you have cplay in a different folder, you will need to change the location inside the batch, in several places, using a text editor.

You can also edit the batch file if you want to use a different file explorer than xplorer2_lite. Note that if you try to kill Windows Explorer, in most versions of Windows, it will kill the whole shell, so it is cleaner and simpler to use another file explorer for selecting your music.

The free file explorer xplorer2_lite can be downloaded from dev's site:

http://zabkat.com/xplorer2_liteTB_setup.exe

NOTE: you'll want to unselect the toolbar installation to keep a minimal setup.

foobar2000 0.8.3 can be downloaded from File Hippo at:

http://filehippo.com/download_foobar2000/55/

otachan's audiophile ASIO plugin for foobar2000 0.8.3 can downloaded in a dizzying array of variations from:

http://personales.ya.com/angel49/foobar2000_otachan/intro.htm

the fourth choice of ver 0.51 seems to be the most generic and works fine.

Monkey's Audio can be downloaded free from the creator's site at:

http://www.monkeysaudio.com/download.html

Lame MP3 encoder and decoder can be downloaded free from:

http://www.rarewares.org/mp3-lame-bundle.php

Shorten 3.6.1 encoder and decoder can be downloaded free from:

http://etree.org/shncom.html

NOTE: Use of any software provided in this message, is done at your own risk and no warranty of any sort is implied. It is proper practice to backup any important data from your computer before installing anything new.



Edits: 02/23/12 03/02/12 03/03/12

This post is made possible by the generous support of people like you and our sponsors:
  VH Audio  


Follow Ups Full Thread
Follow Ups

FAQ

Post a Message!

Forgot Password?
Moniker (Username):
Password (Optional):
  Remember my Moniker & Password  (What's this?)    Eat Me
E-Mail (Optional):
Subject:
Message:   (Posts are subject to Content Rules)
Optional Link URL:
Optional Link Title:
Optional Image URL:
Upload Image:
E-mail Replies:  Automagically notify you when someone responds.