Class LipSyncController
Definition
- Assembly:
- Tizen.AIAvatar.dll
A controller class used to manage lip sync functionality for avatars.
public class LipSyncController : IDisposable
- Inheritance
-
objectLipSyncController
Constructors
View SourceLipSyncController(Avatar)
Initializes a new instance of the LipSyncController class.
Declaration
public LipSyncController(Avatar avatar)
Parameters
| Type | Name | Description |
|---|---|---|
| Avatar | avatar |
Properties
View SourceCurrentTTSClient
Gets the current Text-To-Speech client associated with the Lip Sync Controller.
Declaration
public TtsClient CurrentTTSClient { get; }
Property Value
| Type | Description |
|---|---|
| TtsClient |
Methods
View SourceDeinitializeMic()
Declaration
public void DeinitializeMic()
DeInitializeTTS()
Deinitializes the Text-To-Speech system for use with the Lip Sync Controller.
Declaration
public void DeInitializeTTS()
Dispose()
Releases unmanaged resources used by this instance.
Declaration
public void Dispose()
GetSupportedVoices()
Returns a list of supported voices for the Text-To-Speech system.
Declaration
public List<VoiceInfo> GetSupportedVoices()
Returns
| Type | Description |
|---|---|
| List<><VoiceInfo> |
InitializeMic()
Declaration
public void InitializeMic()
InitializeTTS()
Initializes the Text-To-Speech system for use with the Lip Sync Controller.
Declaration
public void InitializeTTS()
PauseMic()
Declaration
public void PauseMic()
PauseTTS()
Pauses the currently playing Text-To-Speech audio.
Declaration
public void PauseTTS()
PlayLipSync(byte[], int)
Plays the given audio with LipSync and returns whether it was successful or not. If the lip syncer is null, logs an error and returns false. The lipSyncer plays the audio using the provided byte array and sample rate.
Declaration
public bool PlayLipSync(byte[] audio, int sampleRate = 24000)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | audio | The audio data to be played in a byte array format. |
| int | sampleRate | The sampling rate of the audio data, default value is 24000 Hz. |
Returns
| Type | Description |
|---|---|
| bool |
PlayLipSync(string, int)
Plays the given audio with LipSync and returns whether it was successful or not. If the lip syncer is null, logs an error and returns false. The lipSyncer plays the audio using the provided byte array and sample rate.
Declaration
public bool PlayLipSync(string path, int sampleRate = 24000)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | |
| int | sampleRate | The sampling rate of the audio data, default value is 16000 Hz. |
Returns
| Type | Description |
|---|---|
| bool |
PlayPreparedTTS()
Plays the previously prepared Text-To-Speech audio data.
Declaration
public bool PlayPreparedTTS()
Returns
| Type | Description |
|---|---|
| bool |
|
PlayTTS(string, string, EventHandler)
Asynchronously converts the given text into speech using the specified language code and plays the resulting audio once it's ready.
Declaration
public bool PlayTTS(string text, string lang = "ko_KR", EventHandler ttsReadyFinishedCallback = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The text to convert into speech. |
| string | lang | The two-letter ISO 639-1 language code to use for converting the text into speech (default is Korean - ko_KR). |
| EventHandler | ttsReadyFinishedCallback | An optional callback that will be invoked when the TTS process is complete. |
Returns
| Type | Description |
|---|---|
| bool |
|
PlayTTS(string, string)
Converts the given text into speech using the specified language code and plays the resulting audio immediately.
Declaration
public bool PlayTTS(string text, string lang = "ko_KR")
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The text to convert into speech. |
| string | lang | The two-letter ISO 639-1 language code to use for converting the text into speech (default is Korean - ko_KR). |
Returns
| Type | Description |
|---|---|
| bool |
|
PlayTTS(string, VoiceInfo)
Converts the given text into speech using the specified voice info and plays the resulting audio immediately.
Declaration
public bool PlayTTS(string text, VoiceInfo voiceInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The text to convert into speech. |
| VoiceInfo | voiceInfo | The voice info to use for converting the text into speech. |
Returns
| Type | Description |
|---|---|
| bool |
|
PlayTTSAsync(string, VoiceInfo, EventHandler)
Asynchronously converts the given text into speech using the specified voice info and plays the resulting audio once it's ready.
Declaration
public bool PlayTTSAsync(string text, VoiceInfo voiceInfo, EventHandler ttsReadyFinishedCallback = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The text to convert into speech. |
| VoiceInfo | voiceInfo | The voice info to use for converting the text into speech. |
| EventHandler | ttsReadyFinishedCallback | An optional callback that will be invoked when the TTS process is complete. |
Returns
| Type | Description |
|---|---|
| bool |
|
PrepareTTS(string, string, EventHandler)
Prepares the Text-To-Speech engine to synthesize speech from the provided text and language code.
Declaration
public bool PrepareTTS(string text, string lang = "ko_KR", EventHandler ttsReadyFinishedCallback = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The text to convert into speech. |
| string | lang | The two-letter ISO 639-1 language code to use for converting the text into speech (default is Korean - ko_KR). |
| EventHandler | ttsReadyFinishedCallback | An optional callback that will be invoked when the TTS process is complete. |
Returns
| Type | Description |
|---|---|
| bool |
|
PrepareTTS(string, VoiceInfo, EventHandler)
Prepares the Text-To-Speech engine to synthesize speech from the provided text and voice info.
Declaration
public bool PrepareTTS(string text, VoiceInfo voiceInfo, EventHandler ttsReadyFinishedCallback = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The text to convert into speech. |
| VoiceInfo | voiceInfo | The voice info to use for converting the text into speech. |
| EventHandler | ttsReadyFinishedCallback | An optional callback that will be invoked when the TTS process is complete. |
Returns
| Type | Description |
|---|---|
| bool |
|
ResumeMic()
Declaration
public void ResumeMic()
StartMic()
Declaration
public void StartMic()
StopMic()
Declaration
public void StopMic()
StopTTS()
Stops the currently playing Text-To-Speech audio.
Declaration
public void StopTTS()
Events
View SourceTTSReadyFinished
Occurs when text-to-speech synthesis has finished and the audio data is ready to play.
Declaration
public event EventHandler TTSReadyFinished
Event Type
| Type | Description |
|---|---|
| EventHandler |