Class IEnumerableExtensions
- Namespace
- Uralstech.UCloud.TextToSpeech.Voices
Extensions for System.Collections.Generic.IEnumerable<T>.
public static class IEnumerableExtensions
- Inheritance
-
objectIEnumerableExtensions
Methods
FilterByAttributes(IEnumerable<TextToSpeechVoice>, TextToSpeechVoiceGender, TextToSpeechVoiceType)
Finds the voices with the given gender and type from the current collection.
public static IEnumerable<TextToSpeechVoice> FilterByAttributes(this IEnumerable<TextToSpeechVoice> thiz, TextToSpeechVoiceGender gender, TextToSpeechVoiceType type)
Parameters
thizIEnumerable<TextToSpeechVoice>genderTextToSpeechVoiceGenderThe gender of the voice.
typeTextToSpeechVoiceTypeThe type of the voice.
Returns
- IEnumerable<TextToSpeechVoice>
Voices with the type and gender corresponding to
typeandgender.
FilterByGender(IEnumerable<TextToSpeechVoice>, TextToSpeechVoiceGender)
Finds the voices with the given gender from the current collection.
public static IEnumerable<TextToSpeechVoice> FilterByGender(this IEnumerable<TextToSpeechVoice> thiz, TextToSpeechVoiceGender gender)
Parameters
thizIEnumerable<TextToSpeechVoice>genderTextToSpeechVoiceGenderThe gender of the voice.
Returns
- IEnumerable<TextToSpeechVoice>
Voices with the gender corresponding to
gender.
FilterByType(IEnumerable<TextToSpeechVoice>, TextToSpeechVoiceType)
Finds the voices with the given type from the current collection.
public static IEnumerable<TextToSpeechVoice> FilterByType(this IEnumerable<TextToSpeechVoice> thiz, TextToSpeechVoiceType type)
Parameters
thizIEnumerable<TextToSpeechVoice>typeTextToSpeechVoiceTypeThe type of the voice.
Returns
- IEnumerable<TextToSpeechVoice>
Voices with the type corresponding to
type.
FindByAttributes(IEnumerable<TextToSpeechVoice>, TextToSpeechVoiceGender, TextToSpeechVoiceType)
Finds the voice with the given gender and type from the current collection.
public static TextToSpeechVoice FindByAttributes(this IEnumerable<TextToSpeechVoice> thiz, TextToSpeechVoiceGender gender, TextToSpeechVoiceType type)
Parameters
thizIEnumerable<TextToSpeechVoice>genderTextToSpeechVoiceGenderThe gender of the voice.
typeTextToSpeechVoiceTypeThe type of the voice.
Returns
- TextToSpeechVoice
A voice with the type and gender corresponding to
typeandgender, null if not found.
FindByAttributes(IEnumerable<TextToSpeechVoice>, TextToSpeechVoiceGender, params TextToSpeechVoiceType[])
Finds the first voice with the given gender and one of the specified types,
where the order of types in types specifies preference.
public static TextToSpeechVoice FindByAttributes(this IEnumerable<TextToSpeechVoice> thiz, TextToSpeechVoiceGender gender, params TextToSpeechVoiceType[] types)
Parameters
thizIEnumerable<TextToSpeechVoice>The collection of voices to search within.
genderTextToSpeechVoiceGenderThe gender to filter by.
typesTextToSpeechVoiceType[]The types to filter by. Order indicates preference.
Returns
- TextToSpeechVoice
The first voice matching the gender and one of the specified types, or null if none is found.
Remarks
The method searches the collection and returns the first voice that matches the gender and any of the provided types, preferring the order in which the types are listed.
FindByGender(IEnumerable<TextToSpeechVoice>, TextToSpeechVoiceGender)
Finds the voice with the given gender from the current collection.
public static TextToSpeechVoice FindByGender(this IEnumerable<TextToSpeechVoice> thiz, TextToSpeechVoiceGender gender)
Parameters
thizIEnumerable<TextToSpeechVoice>genderTextToSpeechVoiceGenderThe gender of the voice.
Returns
- TextToSpeechVoice
A voice with the gender corresponding to
gender, null if not found.
FindByName(IEnumerable<TextToSpeechVoice>, TextToSpeechVoiceName)
Finds the voice with the given name from the current collection.
public static TextToSpeechVoice FindByName(this IEnumerable<TextToSpeechVoice> thiz, TextToSpeechVoiceName name)
Parameters
thizIEnumerable<TextToSpeechVoice>nameTextToSpeechVoiceNameThe name of the voice.
Returns
- TextToSpeechVoice
A voice with the name corresponding to
name, null if not found.
FindByType(IEnumerable<TextToSpeechVoice>, TextToSpeechVoiceType)
Finds the voice with the given type from the current collection.
public static TextToSpeechVoice FindByType(this IEnumerable<TextToSpeechVoice> thiz, TextToSpeechVoiceType type)
Parameters
thizIEnumerable<TextToSpeechVoice>typeTextToSpeechVoiceTypeThe type of the voice.
Returns
- TextToSpeechVoice
A voice with the type corresponding to
type, null if not found.