Open the dialogue audio file and time each separate line in seconds, writing both a signifier for the line and the start/end times in seconds on a piece of scratch paper. Multiply the seconds by a factor of how many frames per second will be used for the project (usually this is 24-30 frames per second, but it can vary for each cartoon).
Listen to each line of dialogue again and note the time, in seconds, each vowel sound occurs. Multiply the time by the factor of frames per second.
Look into a mirror and sound out each letter of the alphabet. Draw the unique shape the mouth makes next to the relevant letter and post this sheet next to the computer monitor.
Open up a new project in your animation program and press the "On" button on your drawing tablet. Establish the correct number of total frames using the amount you wrote on the dialogue cheat sheet, plus a few seconds worth of extra frames for editing pauses at the beginning and end of the sequence. Draw the key frames (frames with significant changes in movement) of the character, without the mouth on the face. Focus instead on creating the proper body language for the character (i.e. shrugs, forehead slaps and hand gesticulations) as it relates to the dialogue—a character that speaks with his body as well as his mouth will be more convincing, because that's what real people do.
Draw the proper mouth movements onto the key frames of the character. Break the dialogue down into its formative letters to draw the shape of each letter as its said from the mouth. Unless a sequence is particularly focused on a character's mouth, the most pronounced mouth movements will be the vowels—consonants will be primarily denoted by full or partial closing of the mouth, save for F's, which require the lips to be pressed under the teeth momentarily.
Use the "Between frame" function in your animation program to finish the animation sequence. If the particular program does not have that feature, draw the between frames yourself by taking a progressive approach, drawing the frame directly in the middle of two key frames, then repeating the process for the new frames until you have fulfilled the frames per second for the sequence. Save the project in a video format.
Open your video editing program and open the video file for the animation. Lay it onto the horizontal time line at the bottom of the program. Open the dialogue audio file and lay that onto the time line. Adjust the relative positions of both time line pieces until the dialogue matches the timing of the mouth movements. Save and export the video.