Resource for lip synching to voice

Started by Janik, Mon 31/10/2005 03:17:48

Previous topic - Next topic

Janik

Hi everybody,

I found this interesting program called Magpie that is used for synching lip movement to voice:

http://www.thirdwishsoftware.com/magpiepro.html

It is similar to the Pamela program, but more powerful. It is commercial (and expensive :( ) but there is a trial version to play with. The Pro version in particular has a really cool feature: automatic lip synching! It evaluates from the speech file where the phonemes should go, and it looks like it's right 95% of the time or so, depending on the recording quality.

The output of Magpie Pro is not directly compatible with AGS, because AGS expects a Pamela-format file. So I've made a custom file export script for Magpie. By placing this file:

http://www.dmgenie.com/ags/export-pamela.lua

in your \Magpie Pro\Scripts\Export\ folder, you will be able to export directly to a format readable by AGS.

Anyway, I hope this comes in handy for some people. It's a pretty neat program, I think it's worth checking out the trial version.


...


Since the script is short and my link may not be valid forever, here is the script code directly, for future reference:
Code: ags
export = {}; -- create a new export object

-- return label
function export:label()
	return "Pamela";
end

-- return category
function export:category()
	return "2D";
end

-- return argument list 
function export:options()
	groups = {};
	for a,actor in magpie.getactors() do
		for g,group in magpie.getgroups(actor) do
			table.insert(groups, group);
		end
	end
	return { 
		{"group", "Group", "choice", table.concat(groups, "|")},
	  	{"moho_output_file", "Output File", "output_file", "Pamela files (*.pam)\tAll files (*.*)"}
	};
end

-- perform the export
function export:run(from, to, options)
	-- create an array of all the poses that are being exported
	poses = magpie.getposes(options.group);
	
	-- open output file
	fd = io.open(options.moho_output_file, "wt");
	if (fd == nil) then
		return string.format("could not open '%s'", options.moho_output_file);
	end
	
	-- write header line to file
	fd:write("[speech]\n");
	
	-- write data to file
	oldk = "";
	for frame = from, to do
		k = magpie.getgroupvalue(frame, options.group);
		if (k ~= nil and oldk ~= k) then
			fd:write(math.floor(frame*360/magpie.getframerate()) .. ":" .. string.gsub(k, "[^%.]+%.", "") .. "\n");
		end
		oldk = k;
		
		-- update progress bar in main window		
		magpie.progress("Exporting...", (frame - from) / (to - from));
	end

	fd:write("\n");
	fd:write("\n");

	magpie.progress("", 0); -- close progress bar
	
	fd:close(); -- close output file
end
Play pen and paper D&D? Then try DM Genie - software for Dungeons and Dragons!

Rui 'Trovatore' Pires

Wow! Interesting. I'll up it to my site.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Elliott Hird


Rui 'Trovatore' Pires

Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Gilbert

Also, why? I don't see any problems.

Elliott Hird

Hope they don't see you recommending using TRIALS for full use :P

and hope they don't see you making an export script for a competitors format :D

Gilbert

What's the problem? Did he mention using the trial version like a full programme?

What you would do to it is your own responsibility, at least I don't see any sign of him suggesting the pirate of softwares, if you really like a programme after the 30 day trial you may actually pay for it.

Also, what's the problem in creating an export script for a competitor's format?

Janik

I based this script off of one of those which come with the program, but I don't think that's a problem. Plus, if you have Magpie, you don't really need to use Pamela, so it's not like it would take any business away. In fact, I don't think it would load in Pamela (I haven't tried). It's just so that it can work with AGS directly.
Play pen and paper D&D? Then try DM Genie - software for Dungeons and Dragons!

SMF spam blocked by CleanTalk