001/** 002 * Portions Copyright 2001 Sun Microsystems, Inc. 003 * Portions Copyright 1999-2001 Language Technologies Institute, 004 * Carnegie Mellon University. 005 * All Rights Reserved. Use is subject to license terms. 006 * 007 * See the file "license.terms" for information on usage and 008 * redistribution of this file, and for a DISCLAIMER OF ALL 009 * WARRANTIES. 010 */ 011package com.sun.speech.freetts.en.us; 012 013import java.io.IOException; 014import java.net.URL; 015import java.util.Locale; 016 017import com.sun.speech.freetts.Age; 018import com.sun.speech.freetts.Gender; 019import com.sun.speech.freetts.ProcessException; 020import com.sun.speech.freetts.Utterance; 021import com.sun.speech.freetts.UtteranceProcessor; 022 023/** 024 * Defines limited domain synthesis voice that specializes 025 * in telling the time. This is based on data created by 026 * the example time domain voice in FestVox. 027 */ 028public class CMUTimeVoice extends CMUClusterUnitVoice { 029 030 /** 031 * Creates a simple cluster unit voice 032 * 033 * @param name the name of the voice 034 * @param gender the gender of the voice 035 * @param age the age of the voice 036 * @param description a human-readable string providing a 037 * description that can be displayed for the users. 038 * @param locale the locale of the voice 039 * @param domain the domain of this voice. For example, 040 * @param organization the organization which created the voice 041 * "general", "time", or 042 * "weather". 043 * @param lexicon the lexicon to load 044 * @param database the url to the database containing unit data 045 * for this voice. 046 */ 047 public CMUTimeVoice(String name, Gender gender, Age age, 048 String description, Locale locale, String domain, 049 String organization, CMULexicon lexicon, URL database) { 050 super(name, gender, age, description, locale, 051 domain, organization, lexicon, database); 052 } 053 054 /** 055 * The FestVox voice does not take advantage of any post lexical 056 * processing. As a result, it doesn't end up getting certain 057 * units that are expected by the typical post lexical processing. 058 * For example, if "the" is followed by a word that begins with 059 * a vowel, the typical post lexical processing will change its 060 * pronunciation from "dh ax" to "dh iy". We don't want this 061 * in this voice. 062 * 063 * @return the post lexical analyzer in use by this voice 064 * 065 * @throws IOException if an IO error occurs while getting 066 * processor 067 */ 068 protected UtteranceProcessor getPostLexicalAnalyzer() throws IOException { 069 /* Do nothing 070 */ 071 return new UtteranceProcessor() { 072 public void processUtterance(Utterance utterance) 073 throws ProcessException { 074 } 075 }; 076 } 077 078 /** 079 * Converts this object to a string 080 * 081 * @return a string representation of this object 082 */ 083 public String toString() { 084 return "CMUTimeVoice"; 085 } 086}