Exportar (0) Imprimir
Expandir todo

TtsEngineSsml.RemoveLexicon (Método)

Actualización: noviembre 2007

Removes a lexicon currently loaded by the SynthesizerVoice implemented by the current TtsEngineSsml instance.

Espacio de nombres:  System.Speech.Synthesis.TtsEngine
Ensamblado:  System.Speech (en System.Speech.dll)

public abstract void RemoveLexicon(
	Uri uri,
	ITtsEngineSite site
)
public abstract void RemoveLexicon(
	Uri uri,
	ITtsEngineSite site
)
public abstract function RemoveLexicon(
	uri : Uri, 
	site : ITtsEngineSite
)

Parámetros

uri
Tipo: System.Uri
A valid instance of System.Uri indicating the location of the lexicon information.
site
Tipo: System.Speech.Synthesis.TtsEngine.ITtsEngineSite
A reference to an ITtsEngineSite interface passed in by the platform infrastructure to allow access to the infrastructure resources.

A pronunciation lexicon is a collection of words or phrases together with their pronunciations specified using an appropriate pronunciation alphabet.

This method is typically called in response to a System.Speech.Synthesis based applications calling RemoveLexicon and using the SynthesizerVoice implemented by the current TtsEngineSsml instance.

Notas para los herederos:

It is the responsibility of the implementation to be fully familiar with and be able to process the lexicon stored at uri. The implementation must also keep track and manage the lifetimes of all lexicons it removes.

The implementation of RemoveLexicon uses the lexicon URI to query an instance System.Collections.Generic.Dictionary for the System.IO.Stream, closes the stream and removes the uri referring to the lexicon.

public static Dictionary<Uri, Stream> _aLexicons = new Dictionary<Uri, Stream>();

 public void AddLexicon(Uri uri, string mediaType, ITtsEngineSite site) {
    Stream stream = site.LoadResource(uri, mediaType);
    _aLexicons.Add(uri, stream);
}

 public void RemoveLexicon(Uri uri, ITtsEngineSite site) {
     Stream stream;
     if (_aLexicons.TryGetValue(uri, out stream)) {
         stream.Close();
         _aLexicons.Remove(uri);
     }
}

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework y .NET Compact Framework no admiten todas las versiones de cada plataforma. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.

.NET Framework

Compatible con: 3.5, 3.0

Adiciones de comunidad

AGREGAR
Mostrar:
© 2014 Microsoft