Skip to main content

Topic: EAC/iTunes full integration (Read 97167 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • Otto42
  • [*][*][*][*][*]
EAC/iTunes full integration
Edit: Improved scripts and/or executables to accomplish this can be found towards the bottom of the thread. I recommend using the executable version now instead of the script. It's less of a memory hog than scripting will be.

Direct link to EXE: http://otto.homedns.org:8888/iTunes/iTunesEncode.zip
Improved version for iTunes 4.6 and up only: http://otto.homedns.org:8888/iTunes/iTunesEncode46.zip

----
All this scripting being posted here lately got me working on the problem, and here's the solution.

This script will allow you to have EAC use iTunes as the External Compression program. iTunes 4.5 and up required.

How it works:
-EAC rips to a wav file
-EAC calls the script with the proper tags and everything
-The script tells iTunes to compress the file
-The script passes the tags to iTunes, one at a time, which tags the file
-The script copies the resulting file to wherever EAC wants it
-EAC is happy.

There are two modifications to the script that you can make. Both are at the top of the script and easy to understand.
- You can have the script copy the file to where EAC wants it to be (defaults to true)
- You can have the script remove the file from iTunes' library after iTunes finishes encoding (defaults to false)

How to set it all up:
First, get the script from here: http://otto.homedns.org:8888/iTunes/encodeAAC.txt
(I'd appreciate somebody else mirroring it, this is my own box and it goes up and down from time to time)

Second, save the script somewhere and rename it to encodeAAC.js.

Third, set up EAC as follows. In the Compression Options dialog, External Compression Tab:
-Enable "Use external program..."
-Set Parameter passing scheme to "User Defined Encoder"
-Set file extension to ".m4a"
-Make sure that "Add ID3 tag" is disabled.
-Set program to "c:\windows\system32\cscript.exe"
-Set additional command line options to:
"c:\path_to_file\encodeAAC.js" -a "%a" -l "%g" -t "%t" -g "%m" -y %y -n %n %s %d
Change the "path_to_file" with the complete path to wherever you saved the script. Note that quote marks are *VERY IMPORTANT* and must be exactly as I put them in the above line. I had a devil of a time figuring this stuff out, as EAC is a bit weird in some respects.

Finally, in iTunes, go to the preferences and set it to AAC encoder and change the parameters (like bitrate) to be what you want it to use.

And there you go. Enjoy.

Edit: Note that if you have antivirus software like Norton, it may pop up a warning towards the end of the script, when the script attempts to copy the compressed file around. There is no possible way to get around this. Either disable your anti-virus or tell it that the script is safe (Norton will let you do this and can remember that this script is safe to run).
  • Last Edit: 31 January, 2005, 11:53:12 AM by Otto42

  • Busemann
  • [*][*][*][*][*]
EAC/iTunes full integration
Reply #1
By doing this, iTunes won't be storing the disc properties so it can retrieve CDDB tags later though...

  • ShowsOn
  • [*][*][*][*]
  • Members (Donating)
EAC/iTunes full integration
Reply #2
Thanks for the script.

Does it require iTunes 4.5 or higher? I'm still using 4.2.

EAC/iTunes full integration
Reply #3
Quote
Thanks for the script.

Does it require iTunes 4.5 or higher? I'm still using 4.2.

from the top post:

This script will allow you to have EAC use iTunes as the External Compression program. iTunes 4.5 and up required.

  • Otto42
  • [*][*][*][*][*]
EAC/iTunes full integration
Reply #4
Quote
By doing this, iTunes won't be storing the disc properties so it can retrieve CDDB tags later though...

True, but frankly, who cares? EAC is just a better ripper, and I prefer it. I don't much care if iTunes' CDDB lookups don't work.

Anyway, this method looks up the CDDB (FreeDB) tags in EAC and transfers them to iTunes and they get tagged right then and there. Why would you need to tag them again later?

  • Otto42
  • [*][*][*][*][*]
EAC/iTunes full integration
Reply #5
Quote
Thanks for the script.

Does it require iTunes 4.5 or higher? I'm still using 4.2.

Of course you have to have 4.5. 4.2 didn't have scripting capabilities. Although if it's the weird audio thing, there's a method somewhere on these forums to keep the old quicktime codec without the problem but still use iTunes 4.5 (or 4.6, now). That will work fine.

  • ShowsOn
  • [*][*][*][*]
  • Members (Donating)
EAC/iTunes full integration
Reply #6
OK sorry for not reading the first post correctly! I should wake up before I post to HA.org forums.

EAC/iTunes full integration
Reply #7
  • Last Edit: 13 July, 2004, 12:53:51 PM by Sebastian Mares

  • jMc777
  • [*]
EAC/iTunes full integration
Reply #8
Great stuff Otto42! Is there any way of getting this to tell iTunes to encode the files passed from EAC into Apple Lossless?

  • Jack Comics
  • [*][*]
  • Members (Donating)
EAC/iTunes full integration
Reply #9
Beautiful, man.  Absolutely beautiful.  Thank you!

  • ezra2323
  • [*][*][*][*][*]
EAC/iTunes full integration
Reply #10
Very cool!!! Except, I'm "that person" who can't seem to get it to work.

I follwed the instructions exactly. I re-named the text program with a .js extension. I then placed it in my Exact Audio Copy folder, under an iTunes sub-folder. I set the path in additional command line options to : c:\program files\Exact Audio Copy\iTunes\encodeAAC.js" -a "%a" -l "%g" -t "%t" -g "%m" -y %y -n %n %s %d

Id3 is disabled and I have the program set to c:\windows\system32\cscript.exe

Any ideas?

I have iTunes 4.6
  • Last Edit: 29 June, 2004, 02:37:38 PM by ezra2323

  • jMc777
  • [*]
EAC/iTunes full integration
Reply #11
Quote
Very cool!!! Except, I'm "that person" who can't seem to get it to work.

I set the path in additional command line options to : c:\program files\Exact Audio Copy\iTunes\encodeAAC.js" -a "%a" -l "%g" -t "%t" -g "%m" -y %y -n %n %s %d


You need to change;

c:\program files\Exact Audio Copy\iTunes\encodeAAC.js" -a "%a" -l "%g" -t "%t" -g "%m" -y %y -n %n %s %d

to

"c:\program files\Exact Audio Copy\iTunes\encodeAAC.js" -a "%a" -l "%g" -t "%t" -g "%m" -y %y -n %n %s %d

Note the missing " at the beginning of your original command line.
  • Last Edit: 29 June, 2004, 02:44:14 PM by jMc777

  • ezra2323
  • [*][*][*][*][*]
EAC/iTunes full integration
Reply #12
Quote
Note the missing " at the beginning of your original command line


Me=dumb. 

  • Digga
  • [*][*][*][*][*]
EAC/iTunes full integration
Reply #13
Quote
Me=dumb. 

but at least smart enough to _know_ that your'e dumb   
Nothing but a Heartache - Since I found my Baby ;)

  • G-Force
  • [*][*]
EAC/iTunes full integration
Reply #14
Otto, is there any way to have this script rip to Apple Lossless instead of the AAC encoder?

I tried changing one line of the script to the following
Code: [Select]
var    encoder=encoderCollection.ItemByName("Apple Lossless Encoder")


But that didn't work so obviously there is more to it than that 

Do you have any advice?? Many thanks!

  • Otto42
  • [*][*][*][*][*]
EAC/iTunes full integration
Reply #15
Quote
Otto, is there any way to have this script rip to Apple Lossless instead of the AAC encoder?

I tried changing one line of the script to the following
Code: [Select]
var    encoder=encoderCollection.ItemByName("Apple Lossless Encoder")


But that didn't work so obviously there is more to it than that  

Do you have any advice?? Many thanks!
[a href="index.php?act=findpost&pid=224300"][{POST_SNAPBACK}][/a]

Heh. Yeah, you were on the right track..

Possible encoder values are:
AAC Encoder
AIFF Encoder
Lossless Encoder
MP3 Encoder
WAV Encoder

I retrieved these from iTunes using this little script:
Code: [Select]
var    iTunesApp = WScript.CreateObject("iTunes.Application");
var    i;
var fso, tf;
fso = new ActiveXObject("Scripting.FileSystemObject");
tf = fso.CreateTextFile("encoders.txt", true);
var    encoderCollection = iTunesApp.Encoders;
var  count = encoderCollection.Count;
for (i = 1; i <= count; i++)
{
    var    encoder=encoderCollection.Item(i);
    tf.WriteLine(encoder.Name);
}
tf.Close();


So anyway, changing that line you gave to "Lossless Encoder" should do the trick.

  • jMc777
  • [*]
EAC/iTunes full integration
Reply #16
Quote
So anyway, changing that line you gave to "Lossless Encoder" should do the trick.


Superb - thanks Otto42!

  • keiths
  • [*]
EAC/iTunes full integration
Reply #17
Works great! Great work. Thank you very much.

  • Domain
  • [*]
EAC/iTunes full integration
Reply #18
Quote
All this scripting being posted here lately got me working on the problem, and here's the solution.

This script will allow you to have EAC use iTunes as the External Compression program. iTunes 4.5 and up required.

Otto42, I hope you don't mind, but I took the liberty of making a few modifications to this script to make it foobar2000 diskwriter friendly (if it wasn't already). I belive it should still work in EAC, though don't quote me on that since I'm stuck on my laptop and didn't feel like testing it against 2.0x extraction speeds.

Comments about usage are included, and it does require foobar2000 to have foo_clienc installed.

Grab it here:
iTunes.js.txt

This is the first time i've actually used JScript, so hopefully I didn't do anything too boneheaded, but if so feel free to let me know.

Anyway, Otto42 thank you again for the great script 

-----
Domain

  • Otto42
  • [*][*][*][*][*]
EAC/iTunes full integration
Reply #19
Domain: Cool with me. I was working on an EXE version of the script, because some people were having problems with virus checkers and such.

Here you go: http://otto.homedns.org:8888/iTunes/iTunesEncode.zip

It's an EXE version that does the same basic sort of thing. I don't know if it'll work with foo_clienc though. You'll have to tell me what's wrong with it if it won't work. I can probably fix any issues pretty easily.

Feel free to mirror a copy somewhere else if you like (rarewares?), as my connection may go up and down, being on cable and such.

Note that the command line options for this EXE version are similar to the script version, but different, so you may want to read the readme file first. Also, this EXE version does have quite a bit of error checking in it, as opposed to the script which had next to none, but it doesn't check for everything, obviously.


Edit: Oh, I did find one thing while writing this.. If you actually do anything in iTunes while it's running (both the EXE and the script versions), it'll fail miserably. Meaning don't click on iTunes while it's converting. Doing so can cause the loop where the script is waiting on iTunes to finish to exit out early, and of course it fails at that point. I see no easy way to fix this, it's iTunes being weird.
  • Last Edit: 11 July, 2004, 03:17:34 AM by Otto42

  • Domain
  • [*]
EAC/iTunes full integration
Reply #20
Quote
It's an EXE version that does the same basic sort of thing. I don't know if it'll work with foo_clienc though. You'll have to tell me what's wrong with it if it won't work. I can probably fix any issues pretty easily.


Very nice 

I played around with this briefly and didn't find anything particularly problematic. The only issues (ones that I also ran into modifying the script) was that iTunes expects/requires something in the "Name" field, so if you don't specify this, it creates a tag based on the filename. The only problem with this is that the tag it creates automatically is based on whatever temporary file it used to do the conversion, not the final filename (so if foobar's case, you end up with something like "<filename>.m4a.fb2k.tmp". Because of this, I ended up adding the small regular expression when I modified the script to change this tag to the final output's filename.

Also for the -d option, do you expect it to actually delete the physical file from the iTunes library? The only behaviour i've seen from Delete() is removal from the library, not actual removal of the file (perhaps this is because of options in my iTunes?).

Thanks again,

-----
Domain

EAC/iTunes full integration
Reply #21
Quote
Feel free to mirror a copy somewhere else if you like (rarewares?), as my connection may go up and down, being on cable and such.
[{POST_SNAPBACK}][/a]


Available at...

[a href="http://vbspot.sourceforge.net/file_manager/ressources/iTunesEncode.zip]http://vbspot.sourceforge.net/file_manager...TunesEncode.zip[/url]
  • Last Edit: 13 July, 2004, 12:54:08 PM by Sebastian Mares

  • Otto42
  • [*][*][*][*][*]
EAC/iTunes full integration
Reply #22
Quote
Also for the -d option, do you expect it to actually delete the physical file from the iTunes library? The only behaviour i've seen from Delete() is removal from the library, not actual removal of the file (perhaps this is because of options in my iTunes?).
[a href="index.php?act=findpost&pid=224952"][{POST_SNAPBACK}][/a]

Huh. I'll be darned, you're right. Okay, I fixed that problem in the EXE version. It'll delete the file itself now too.

Sebastian: Might want to grab another copy of the file for your mirrors.
  • Last Edit: 11 July, 2004, 03:18:59 PM by Otto42

  • aSceT
  • [*]
EAC/iTunes full integration
Reply #23
Great script! Can it be somehow used with Foobar's CliEnc?

  • Tomb
  • [*][*][*]
  • Members (Donating)
EAC/iTunes full integration
Reply #24
Quote
Great script! Can it be somehow used with Foobar's CliEnc?
[a href="index.php?act=findpost&pid=225010"][{POST_SNAPBACK}][/a]


Read Domains messages above.