using UnityEngine;
using System.Collections;
namespace Crosstales.RTVoice.Provider
{
/// Interface for all voice providers.
public interface IVoiceProvider
{
#region Properties
/// Returns the extension of the generated audio files.
/// Extension of the generated audio files.
string AudioFileExtension { get; }
/// Returns the type of the generated audio files.
/// Type of the generated audio files.
AudioType AudioFileType { get; }
/// Returns the default voice name of the current TTS-provider.
/// Default voice name of the current TTS-provider.
string DefaultVoiceName { get; }
/// Get all available voices from the current TTS-provider and fills it into a given list.
/// All available voices (alphabetically ordered by 'Name') as a list.
System.Collections.Generic.List Voices { get; }
/// Maximal length of the speech text (in characters).
/// The maximal length of the speech text.
int MaxTextLength { get; }
/// Indicates if this provider is working directly inside the Unity Editor (without 'Play'-mode).
/// True if the provider is working directly inside the Unity Editor.
bool isWorkingInEditor { get; }
/// Indicates if this provider is working with 'Play'-mode inside the Unity Editor.
/// True if this provider is working with 'Play'-mode inside the Unity Editor.
bool isWorkingInPlaymode { get; }
/// Indicates if this provider is supporting SpeakNative.
/// True if this provider supports SpeakNative.
bool isSpeakNativeSupported { get; }
/// Indicates if this provider is supporting Speak.
/// True if this provider supports Speak.
bool isSpeakSupported { get; }
/// Indicates if this provider is supporting the current platform.
/// True if this provider supports current platform.
bool isPlatformSupported { get; }
/// Indicates if this provider is supporting SSML.
/// True if this provider supports SSML.
bool isSSMLSupported { get; }
/// Indicates if this provider is an online service like MaryTTS or AWS Polly.
/// True if this provider is an online service.
bool isOnlineService { get; }
/// Indicates if this provider uses co-routines.
/// True if this provider uses co-routines.
bool hasCoRoutines { get; }
/// Indicates if this provider is supporting IL2CPP.
/// True if this provider supports IL2CPP.
bool isIL2CPPSupported { get; }
/// Indicates if this provider returns voices in the Editor mode.
/// True if this provider returns voices in the Editor mode.
bool hasVoicesInEditor { get; }
/// Get all available cultures from the current provider (ISO 639-1).
/// All available cultures (alphabetically ordered by 'Culture') as a list.
System.Collections.Generic.List Cultures { get; }
#endregion
#region Methods
/// Silence all active TTS-providers.
void Silence();
/// Silence the current TTS-provider (native mode).
/// UID of the speaker
void Silence(string uid);
/// The current provider speaks a text with a given voice (native mode).
/// Wrapper containing the data.
IEnumerator SpeakNative(Model.Wrapper wrapper);
/// The current provider speaks a text with a given voice.
/// Wrapper containing the data.
IEnumerator Speak(Model.Wrapper wrapper);
/// The current provider generates an audio file from a text with a given voice.
/// Wrapper containing the data.
IEnumerator Generate(Model.Wrapper wrapper);
/// The provider speaks a text with a given AudioClip.
/// Wrapper containing the data.
/// AudioClip with the speech audio.
IEnumerator SpeakWithClip(Model.Wrapper wrapper, AudioClip clip);
/// Load the provider (e.g. all voices).
/// Force reload the provider (default: false, optional).
void Load(bool forceReload = false);
#endregion
#region Editor-only methods
#if UNITY_EDITOR
/// The current provider speaks a text with a given voice (native mode & Editor only).
/// Wrapper containing the data.
void SpeakNativeInEditor(Model.Wrapper wrapper);
/// Generates an audio file with the current provider (Editor only).
/// Wrapper containing the data.
void GenerateInEditor(Model.Wrapper wrapper);
#endif
#endregion
}
}
// © 2018-2020 crosstales LLC (https://www.crosstales.com)