1 – 4 of 4
Blogger Unknown said...

Nice to see you improved my simple batch file, it's way better like this!
Ill update my blog and link to your page so visitors can find the improved version!

Cheers!
-- Pieter

20 July, 2008 15:26

Blogger Unknown said...

Thanks for posting this script. This doesn't appear to transfer the tag info. Have you found any options for this?

30 July, 2008 23:32

Blogger Yakko Warner said...

The script just automates two separate tools: FAAD, that converts the M4A to generic uncompressed WAV; and LAME, that encodes the WAV to MP3. Since WAV doesn't support tag information (as far as I know; in any case, the tools don't have any support for embedding tags in a WAV), that information is lost in that intermediate step.

I did find a utility here that can copy tags from one file to another, but unfortunately it doesn't support M4As. And then I found a forum thread here about a tool that deals with M4A tags. And then I had to go back to work. ;)

It would seem like it shouldn't take much to combine the two programs into something that could read and write both MP3s and M4As. If I come across something where someone's done that, I'll add it to this script. Unless I manage to get my hands on a C++ compiler and some free time...

31 July, 2008 11:20

Blogger Alexey said...

Greetings,

I needed this for use in a C#/.NET program, and ended up writing a wrapper. The code (for anyone who finds this) is as follows:

public static void Convert(string fromPath, string toPath)
{
int lastIndex = fromPath.Contains("\\") ? fromPath.Substring(fromPath.LastIndexOf('\\') + 1) : 0;
string tempFileName = Environment.CurrentDirectory + "\\temp\\" + fromPath.Substring(lastIndex);

if(File.Exists(tempFileName))
{
File.Delete(tempFileName);
}
if(!Directory.GetParent(tempFileName).Exists)
{
Directory.GetParent(tempFileName).Create();
}

Interaction.Shell(String.Format("faad.exe -o {0} {1}",
InQuotes(tempFileName),
InQuotes(fromPath)),
AppWinStyle.Hide, true, -1);
Interaction.Shell(String.Format("lame.exe --preset standard {0} {1}",
InQuotes(tempFileName),
InQuotes(toPath)),
AppWinStyle.Hide, true, -1);

File.Delete(tempFileName);
}

private static string InQuotes(string withoutQuotes)
{
return "\"" + withoutQuotes + "\"";
}

27 September, 2008 15:58

Your civil comments are appreciated. Thanks!
You can use some HTML tags, such as <b>, <i>, <a>

This blog does not allow anonymous comments.

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.
Please prove you're not a robot