Archive for March, 2006

AAC Encoding License: 2006-03-23

Thursday, March 23rd, 2006

That’s true. If ever I have a few extra bucks, I’d like to acquire at least one Mac PC. I’m a big fan of UNIX, and since Mac OS appears to be built on UNIX, it’s gotta be pretty good. :-)

 

Tom

AAC Encoding License

Thursday, March 23rd, 2006

There was a one-time administrative fee of roughly $15,000, which is determined by how many copies of the program I’d be selling to users. And then, you had to pay additional for each license. Since I would not be selling, they said they could reduce this fee to a few thousand. But that was still too steep for me. I requested a copy of their license agreement and fee schedule for exact numbers. We’ll see how it looks when it gets here. But it seems that they want their money, and lots of it. J I doubt they’ll be very sympathetic to a one-man development shop (like mine) that wants to use AAC strictly for their own purposes.

Tom

WAV to MP4 Batch Conversions: 2006-03-23

Thursday, March 23rd, 2006

Again, [...], thanks very much. You’ve been most helpful.

I’ve solved the problem for now by writing a program (like a script though it is written in C++) that reads a list of WAVE files from a directory, then simulates an end user by issuing the necessary events and keystrokes to QuickTime Pro to get it to import each file, then export it to MP4. It’s kludgy to be sure; when running it, one sees various QuickTime windows and menus opening and closing as each WAVE file is processed. But hey, it gets the job done, and I won’t have to pay thousands of dollars for an AAC license. :-)  This solution should work well until QuickTime has a batch exportation facility, or offers AAC encoding in its API for Windows, without the licensing requirement.

 

Take care,
Tom Hesley, Tommy’s Tunes Disc Jockey Services

WAV to MP4 Batch Conversions

Wednesday, March 22nd, 2006

By the way, what I’m really after is to perform unattended batch conversions of WAVE files to MP4, and I don’t see any obvious way to do that in Quicktime 7 Pro. That UI seems to require manual intervention for converting each file. Do you know if such a way exists? I was able to do this when converting files to MP3 with Cakewalk’s Pyro software. They give a dialog box that allows you to select all files for conversion, not just one.

I would also suggest that Apple update the return codes for the ConvertMovieToFile() function, so that a specific code for “License required” is issued when someone attempts to do what I was, without such a license. This would have saved you a little time, and me lots of time. :-)

 

Thanks very much again for your help,
Tom Hesley

WAV to MP4 Export Issues

Wednesday, March 22nd, 2006

Yes, that’s right. I’m running Windows and wish to export AAC audio. I remember seeing this article, but figured that I could use the API since I have QuickTime Pro installed. Oh well. I suppose I can write a program to operate the Quicktime Pro UI in batch mode (I have many, many files to convert). I’ll look into the licensing however, and if it’s not too expensive, will go that route.

 

Thanks for the help,
Tom Hesley

WAV to MP4 -2009 Code

Tuesday, March 21st, 2006

I tried your suggestion. The call to FindNextComponent() with the modification to the component description that you suggested is still succeeding. However, still getting the -2009 code.

 

Tom Hesley

WAV to MP4 Export Problems

Tuesday, March 21st, 2006

Friends,

I’m getting an invalid track code (-2009) when exporting WAVE audio to MP4. Can anyone offer a solution?

Points to consider are:

  • I’m running QuickTime Pro 7.0.3.
  • Using the QT7 SDK and linking with the qtmlClient.lib library.
  • Developing with MS Visual C++ 2003 .NET on a Windows XP Pro P4 machine.
  • I’ve successfully played ‘movie’ once it’s imported, just prior to exportation to MP4.
  • Notice that I’m asking that the user input dialog be displayed which prompts for compression and file types, kbps values, and such. Even with that user input, the function in red below gives the -2009 error.
  • My WAVE files are stereo with 16-bit single-channel sample sizes, and were sampled at 44.1 Khz.

Here’s my code…

// Initialize the QuickTime environment.
InitializeQTML(0L); // Initialize QTML
EnterMovies(); // Initialize QuickTime

// Format the input WAVE file name.
FSSpec inFileRec, outFileRec;
NativePathNameToFSSpec(
“G:\\Music\\WAV Unnormalized\\Sex Bomb (Peppermint Disco Mix) – Tom Jones & Mousse T..wav”,
&inFileRec,
0L);

// Format the output file name.
NativePathNameToFSSpec(
“G:\\Music\\Mp4\\Sex Bomb (Peppermint Disco Mix) – Tom Jones & Mousse T..mp4″,
&outFileRec,
0L);

// Open the input WAVE file for reading.
short inFileRefNum;
OSErr nErr = OpenMovieFile(&inFileRec, &inFileRefNum, fsRdPerm);

// Create a QuickTime movie (in memory) from the WAV file.
Movie movie = NULL;
short inResId = 0;
Str255 strName;
Boolean bWasChanged;
nErr = NewMovieFromFile( &movie,
inFileRefNum,
&inResId,
NULL,
newMovieActive,
&bWasChanged);

long trackCount = GetMovieTrackCount(movie);
// This call ^^^ returns a track count of 1, which is seems reasonable. My WAV files are stereo
// however, so should this count perhaps be 2 ?

// At any rate, things appear to be working correctly so far…

// Get the MP4 component for the exportation, so I can set certain export parameters…
Component c = 0;
ComponentInstance theExporter = NULL;
ComponentDescription cd =
{
kAnyComponentType,
kQTFileTypeMP4,
kAppleManufacturer,
0,
0};

OSErr err = invalidComponentID;
c = FindNextComponent(0, &cd);
if (c == 0)
{
MessageBox(hWnd, “Could not find component.”, “Error”, MB_OK);
}

err = OpenAComponent(c, &theExporter);
if (err || theExporter == 0)
{
MessageBox(hWnd, “Could not open the MP4 exporter.”, “Error”, MB_OK);
};

// find the first sound track in the specified movie
Track myTrack = GetMovieIndTrackType(movie, 1, AudioMediaCharacteristic, movieTrackCharacteristic | movieTrackEnabledOnly);
if (myTrack == NULL)
{
MessageBox(hWnd, “Could not get audio track.”, “Error”, MB_OK);
}

// I called the GetMovieIndTrackType() function just to verify that the track information could be
// retrieved.

// So far, so good. All functions to this point succeed.
// Now, export the audio-only movie to MP4…
err = ConvertMovieToFile(movie,
NULL,
&outFileRec,
kQTFileTypeMP4,
FOUR_CHAR_CODE(‘TVOD’),
smSystemScript,
NULL,
showUserSettingsDialog | movieToFileOnlyExport |movieFileSpecValid, theExporter);

// This ConvertMovieToFile() call ^^^^ is returning the -2009 error and I just don’t understand why.

// Close the movie.
CloseComponent(theExporter);
CloseMovieFile(inFileRefNum);
DisposeMovie(movie);

// Properly clean up and stop the QuickTime functionality.
ExitMovies(); // Terminate QuickTime
TerminateQTML(); // Terminate QTML

 

Thanks in advance,
Tom Hesley

Ellie’s Mom Passed Away

Monday, March 20th, 2006

Dear [C],

Okay, thanks for the update.

Tom Hesley

Soundproof Carpet for Office

Friday, March 17th, 2006

Thanks very much. I’m looking forward to doing business with you.

By the way, I took your suggestion today about getting some better weather-striping for the noisy door. I’m going to apply it over the weekend and see how it goes.

Later,
Tom

Updating Lex: 2006-03-17

Friday, March 17th, 2006

Hi [Lex].

All is well here. I’m keeping busy with little maintenance projects around the house, a bit of wiring and plumbing, and such.

I’m glad to hear you’re doing okay. I talk to [Jack] now and again, and he keeps me informed about you.

Yes, I’m hoping to come down in April for a weekend. Hopefully, I’ll see you then.

 

Take care,
Tom