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: EAC/iTunes full integration (Read 105863 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

EAC/iTunes full integration

Reply #25
Quote
Great script! Can it be somehow used with Foobar's CliEnc?
[a href="index.php?act=findpost&pid=225010"][{POST_SNAPBACK}][/a]


I highly suggest using Otto42's executable instead of my script, seeing as he probably does quite  a bit more error handling (though I did test the script against ~ 800 file conversion).

Just add a new output preset for command-line encoder, specify the path to iTunesEncode.exe in the "encoder" field, set the "extension" field to m4a, and put something similar to this in the "arguments" field:

-a "%artist%" -l "%album%" -t "%title%" -g "%genre%" -y %date% -n %track% -i %s -o %d

If your strictly using it to convert files, and not for use with iTunes, drop in the -d option as well. Of course the options are dependant on the name of foobar's metatags.

Works like a charm 

-----
Domain

EAC/iTunes full integration

Reply #26
Quote
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.
[a href="index.php?act=findpost&pid=224833"][{POST_SNAPBACK}][/a]


Otto42, have you looked at _IiTunesEvents interface for handling this? I've been tinkering with it very briefly in JScript, but OO stuff isn't quite my cup of tea, so actually implementing it might take more then just a little tinkering.

In JScript, you could do something like this:

Code: [Select]
function eventHandler_OnCOMCallsEnabledEvent()
{
...some stuff here...
}

function eventHandler_OnCOMCallsDisabledEvent(disabledReason)
{
...some stuff here...
}

var iTunesApplication = WScript.CreateObject("iTunes.Application");
WScript.ConnectObject(iTunesApplication, "eventHandler_");


So if the user plays around with the dialogs, these functions get "fired".

Anyway, perhaps you've already looked at these, and i'm just rambling on 

-----
Domain

EAC/iTunes full integration

Reply #27
Quote
-a "%artist%" -l "%album%" -t "%title%" -g "%genre%" -y %date% -n %track% -i %s -o %d

While I can get the script to work just fine, I'm still having trouble getting the executable to run. I pasted this exact line in the additional commandline options of EAC and the program just starts and quits and doesn't offload the wav file to iTunes. Do you have any idea what is wrong?

EAC/iTunes full integration

Reply #28
Quote
While I can get the script to work just fine, I'm still having trouble getting the executable to run. I pasted this exact line in the additional commandline options of EAC and the program just starts and quits and doesn't offload the wav file to iTunes. Do you have any idea what is wrong?
[a href="index.php?act=findpost&pid=225050"][{POST_SNAPBACK}][/a]


The command-line I specified is for foobar2000's foo_clienc, so I don't see it working properly in EAC. As for EAC it should be something like:

-a "%a" -l "%g" -t "%t" -g "%m" -y %y -n %n -i %s -o %d

Hope that helps,

-----
Domain

EAC/iTunes full integration

Reply #29
I have found that with the EXE version, iTunes needs to be running already. For some reason, iTunes will not automatically start up like the script version causes it to do. I do not know why, yet. But it works fine if iTunes is already running, so that's the simple workaround.

Domain: I'll look into that event interface.

EAC/iTunes full integration

Reply #30
Quote
The command-line I specified is for foobar2000's foo_clienc, so I don't see it working properly in EAC. As for EAC it should be something like:

-a "%a" -l "%g" -t "%t" -g "%m" -y %y -n %n -i %s -o %d

Hope that helps,

Yup, that did the trick. Thank you for clarifying the differences between EAC and Foobar commands. I manage my music on my Mac, but I use my PC for ripping so this little app is just what I've been looking for.

Otto and Domain: FANTASTIC WORK to you both! This little app is great! 

EAC/iTunes full integration

Reply #31
Is EAC that much better than iTunes' ripper with error correction enabled?

EAC/iTunes full integration

Reply #32
Quote
Is EAC that much better than iTunes' ripper with error correction enabled?
[a href="index.php?act=findpost&pid=225106"][{POST_SNAPBACK}][/a]



Find a very scratched CD. Try to rip with the iTunes ripper and then EAC in secure-mode. Everyone has atleast one badly scratched CD don't they?
myspace.com/borgei - last.fm/user/borgei

 

EAC/iTunes full integration

Reply #33
Quote
Is EAC that much better than iTunes' ripper with error correction enabled?
[a href="index.php?act=findpost&pid=225106"][{POST_SNAPBACK}][/a]

I would say it's probably better, but it is without a doubt FASTER than iTunes ripper. I can securely rip a CD in EAC at about 3x speed. iTunes? It gets about 0.4x-0.6x with Error Correction enabled.

The big thing about EAC, as I understand it, is that it tells you when it is not able to accurately rip a CD by the report it generates at the end. It gives you a quality level percentage and other statistics to let you know how well it did at extracting that data off the disc.

EAC/iTunes full integration

Reply #34
Hello,

Maybe iam Dumb but maybe my English is to bad to get the Script Working

Can u give me some Example for the Command Line to Rip the to 128 kbits mp3

and to AAC ?

Thank you very Much.

A Question by the Way is the mp3 Encoder from itunes better as the Cool Edit Plugin ?

EAC/iTunes full integration

Reply #35
Quote
Quote
Is EAC that much better than iTunes' ripper with error correction enabled?
[a href="index.php?act=findpost&pid=225106"][{POST_SNAPBACK}][/a]

I would say it's probably better, but it is without a doubt FASTER than iTunes ripper. I can securely rip a CD in EAC at about 3x speed. iTunes? It gets about 0.4x-0.6x with Error Correction enabled.
[a href="index.php?act=findpost&pid=225121"][{POST_SNAPBACK}][/a]


That's interesting - I get about 7x with EC enabled - I haven't switched it off recently, but I recall getting up to 14x with iTunes 4.0 when it was released and didn't have that option...

EAC/iTunes full integration

Reply #36
are you sure your program handles the year/genre tag correctly?

with the following parameter line:
-a "%a" -l "%g" -t "%t" -g "%m" -y "%y" -n "%n" -d -i %s -o %d

i get
genre tag=year tag, but not year tag at all 

I should add that I use the German version of iTunes (4.6)

EAC/iTunes full integration

Reply #37
Quote
are you sure your program handles the year/genre tag correctly?

with the following parameter line:
-a "%a" -l "%g" -t "%t" -g "%m" -y "%y" -n "%n" -d -i %s -o %d

i get
genre tag=year tag, but not year tag at all  

I should add that I use the German version of iTunes (4.6)
[a href="index.php?act=findpost&pid=225209"][{POST_SNAPBACK}][/a]


I notied this problem as well, it seems -g is linked to the year field, and I have no clue what is happening to -y (everything else seems to be working properly).

...On a tangent...

It seems iTunes only allows its specified genre's to be added to the genre field, i.e. if you send it "Anime" as the genre, it is either removing that tag completely, or leaves the tag but does not display it in the interface (I'm not completely sure whether it is completely removing the tag, or the effect on the iPod or 3rd party programs).

-----
Domain

EAC/iTunes full integration

Reply #38
Quote
Hello,

Can u give me some Example for the Command Line to Rip the File to 128 kbits mp3


Thank you very Much.

A Question by the Way is the mp3 Encoder from itunes better as the Cool Edit Plugin ?

[a href="index.php?act=findpost&pid=225149"][{POST_SNAPBACK}][/a]




EAC/iTunes full integration

Reply #39
Quote
I notied this problem as well, it seems -g is linked to the year field, and I have no clue what is happening to -y (everything else seems to be working properly).

I'll take a look at it this afternoon. Probably a simple typo or something.

Quote
...On a tangent...

It seems iTunes only allows its specified genre's to be added to the genre field, i.e. if you send it "Anime" as the genre, it is either removing that tag completely, or leaves the tag but does not display it in the interface (I'm not completely sure whether it is completely removing the tag, or the effect on the iPod or 3rd party programs).

That should not be the case. iTunes is certainly capable of arbitrary Genre within the iTunes interface itself, I see no obvious reason why the COM interface would be any different. Not saying you're wrong, but it makes no real sense unless they did something very stupid in iTunes. Which, frankly, I wouldn't put past them (sigh).

Have you tried it on AAC files or MP3 file or both? I could see it breaking down if you tried a custom Genre on an MP3 file with only ID3v1 tags, which didn't allow for custom Genre entries, as I recall.

EAC/iTunes full integration

Reply #40
Quote
Hello,

Maybe iam Dumb but maybe my English is to bad to get the Script Working

Can u give me some Example for the Command Line to Rip the to 128 kbits mp3

and to AAC ?

Thank you very Much.

A Question by the Way is the mp3 Encoder from itunes better as the Cool Edit Plugin ?
[a href="index.php?act=findpost&pid=225149"][{POST_SNAPBACK}][/a]

There are other posts in this thread that answer your question, but this should make everything more clear. These settings apply to the .exe iTunes encoder discussed in this thread, not the script. Set the bitrate that you want to encode at in iTunes itself.

To use EAC to rip to iTunes MP3 use
Code: [Select]
-e "MP3 Encoder" -a "%a" -l "%g" -t "%t" -g "%m" -y %y -n %n -i %s -o %d


To use EAC to rip to iTunes AAC use
Code: [Select]
-e "AAC Encoder" -a "%a" -l "%g" -t "%t" -g "%m" -y %y -n %n -i %s -o %d

Note that iTunes MP3 encoder is not very good based on other listening tests conducted here, so I suggest using the AAC encoder for lossy compression.

EAC/iTunes full integration

Reply #41
 

Thank you very Much it works Perfect.

Now i Understand

EAC/iTunes full integration

Reply #42
Quote
That's interesting - I get about 7x with EC enabled - I haven't switched it off recently, but I recall getting up to 14x with iTunes 4.0 when it was released and didn't have that option...
[a href="index.php?act=findpost&pid=225170"][{POST_SNAPBACK}][/a]


Myself i get about 11-13x (without EC enabled), with a Plextor PX-W4824A (48/24/48) and a Athlon XP2000+. iTunes ripping is speedlimited by how fast the CPU is at encoding the AAC files (or mp3, ale, etc).

I can't even try enabling Error Correction in iTunes. It almost locks up, and the ripping goes at 0,1-0,3x, and spins up and down the drive all the time. This must be a bug with iTunes + Plextor drives, since many people with that combination have reported this. Still, since version iTunes 4.1, it has not been fixed.
myspace.com/borgei - last.fm/user/borgei

EAC/iTunes full integration

Reply #43
Quote
That should not be the case. iTunes is certainly capable of arbitrary Genre within the iTunes interface itself, I see no obvious reason why the COM interface would be any different. Not saying you're wrong, but it makes no real sense unless they did something very stupid in iTunes. Which, frankly, I wouldn't put past them (sigh).
[a href="index.php?act=findpost&pid=225263"][{POST_SNAPBACK}][/a]

Okay, did some further testing and I was incorrect. Strange, when I was still doing this manually (convert via foo_nero -> AAC and manually import into iTunes) it didn't take any of my genre tags....maybe it was just a fluke.

Anyway, I spent more time with the iTunes _IiTunesEvents interface, but apparently i'm too dense to understand how to use it...I have no problems detecting when COM is enabled/disabled, but you can't just do a simple Sleep() in your specified function, or it blocks up iTunes from doing anything else... the only think I could think of off the top of my head is to wrap every single call to the iTunes interface with a event sink, but it certainly doesn't seem to be a very intelligent way of doing things... maybe this is a job for multithreading? (something I know nothing about)

Finally, if you don't mind, might I ask what iTunesEncoder was written in? I've been toying with a C# version because its quite easy to gain access to the interfaces, but I don't quite grasp how to do that same thing in C++? (.Net is surely simple, but i'd rather have a native application).

Thanks,

-----
Domain


EAC/iTunes full integration

Reply #45
Quote
Anyway, I spent more time with the iTunes _IiTunesEvents interface, but apparently i'm too dense to understand how to use it...I have no problems detecting when COM is enabled/disabled, but you can't just do a simple Sleep() in your specified function, or it blocks up iTunes from doing anything else... the only think I could think of off the top of my head is to wrap every single call to the iTunes interface with a event sink, but it certainly doesn't seem to be a very intelligent way of doing things... maybe this is a job for multithreading? (something I know nothing about)

I'm willing to bet that you know more about it than I do. I don't grok COM yet. I learned a lot trying to code the EXE version (the magic of interfaces, for example, and how that magic is a PITA to work with), but I haven't tried to mess with events yet. I'm looking into it.

Quote
Finally, if you don't mind, might I ask what iTunesEncoder was written in? I've been toying with a C# version because its quite easy to gain access to the interfaces, but I don't quite grasp how to do that same thing in C++? (.Net is surely simple, but i'd rather have a native application).

I wrote it in Visual C++ 6.0. I simply used the two files they included in the COM SDK. Include the iTunesCOMInterface.h, do CoInitialize(NULL) to init COM, then do this to create the iTunes object:
Code: [Select]
HRESULT hRes;
IiTunes * iiTunes = NULL;
hRes = ::CoCreateInstance(CLSID_iTunesApp, NULL, CLSCTX_LOCAL_SERVER, IID_IiTunes, (PVOID *)&iiTunes);


Working with this crap in C++ is nowhere near as friendly as scripting or probably C# is. Consider the following:
Code: [Select]
IITEncoderCollection * encoderCollection = NULL;
hRes = iiTunes->get_Encoders(&encoderCollection);
IITEncoder * encoder = NULL;
hRes = encoderCollection->get_ItemByName(encoderName.AllocSysString(),&encoder);
if (hRes != S_OK || encoder == NULL)
{
// deal with error


And so on. Because the functions always return an HRESULT, it's not really too awful object oriented. If they returned something more like the script, that above code could become:
Code: [Select]
IITEncoder * encoder = iiTunes->get_Encoders()->get_ItemByName(encoderName.AllocSysString());
if (encoder == NULL)
{
// deal with error


EAC/iTunes full integration

Reply #47
Thanks Otto, maybe in the future you could also add options to set other tags as well. Total tracks, performer, disc # for instance. Just an option.

EAC/iTunes full integration

Reply #48
Is there any chance this could be done without iTunes, ie. through QuickTime?

Since I play all my music with foobar2000, I would like to avoid having to install iTunes, yet being able to easily use the best AAC encoder available.

By the way, this method could also enable us to use even more formats, like 3GPP, which seems very interesting for ultra low bitrates.

EAC/iTunes full integration

Reply #49
Quote
Is there any chance this could be done without iTunes, ie. through QuickTime?

Since I play all my music with foobar2000, I would like to avoid having to install iTunes, yet being able to easily use the best AAC encoder available.

By the way, this method could also enable us to use even more formats, like 3GPP, which seems very interesting for ultra low bitrates.
[{POST_SNAPBACK}][/a]


You can use [a href="http://freeware.efenstor.net/qutibacoas.htm]qutibacoas[/url] for this.