SoundPlayer

class SoundPlayer(address: Long, isRef: Boolean) : GemNativeObj

Sound player interface. To be used by user-defined players.

Constructors

Link copied to clipboard
constructor(address: Long, isRef: Boolean)

Types

Link copied to clipboard
object Companion

SoundPlayer companion object.

Properties

Link copied to clipboard

Address of native referenced object. nullptr if not referencing any native allocated object. Note native allocation will happen only once.

Functions

Link copied to clipboard
external fun cancel(listener: ISoundPlayingListener): Int

Cancels the play operation associated with the provided listener.

Link copied to clipboard

Checks if this player supports the specified MIME type

Link copied to clipboard

Checks if this player supports the specified MIME type

Link copied to clipboard

Checks if this player supports the specified TTS EMimeType.

Link copied to clipboard

Checks if this player supports the specified TTS EMimeType.

Link copied to clipboard
fun finalize()

Overrides finalize that garbage collector will call when needed.

Link copied to clipboard
external fun getDefaultLanguage(): Language?

Returns an ILanguage instance describing the language currently being used in system as the default TTS language. This is required for TTS players.

Link copied to clipboard
external fun getLanguage(): Language?

Gets the TTS language. Returns the last language set by this by a SetLanguage call to the same instance.

Link copied to clipboard

Gets the list of languages natively supported by the player. This is required for TTS players.

Link copied to clipboard
fun getTtsSupportLevel(langCode: String, regionCode: String, scriptCode: String): ETtsSupportLevel

Get the TTS support level for specified language This is required for TTS players.

Link copied to clipboard
fun getTtsSupportLevelAsInt(langCode: String, regionCode: String, scriptCode: String): Int

Get the TTS support level for specified language This is required for TTS players.

Link copied to clipboard

True if keeps a reference to a C++ SDK object False if keeps a C++ SDK object

Link copied to clipboard
operator fun not(): Boolean

Checks if this object is valid.

Link copied to clipboard
external fun play(source: ISoundSource, preferences: SoundPlayingPreferences, listener: ISoundPlayingListener): Int

Play the requested sound. The provided progress listener will be used also for canceling the play. A progress listener can be attached to only one play operation at a time. The player will release the source when no more needed.

Link copied to clipboard
external fun playingSoundsCount(): Int

Returns the number of sounds currently playing on this player.

Link copied to clipboard
external fun playSources(sources: ArrayList<ISoundSource>, preferences: SoundPlayingPreferences, listener: ISoundPlayingListener): Int

Play the requested sounds list. The provided progress listener will be used also for canceling the play. A progress listener can be attached to only one play operation at a time. The player will release the source when no more needed.

Link copied to clipboard
fun release()

Releases the native referenced value of this object if:

Link copied to clipboard
external fun setLanguage(value: Language): Int

Sets the TTS language. This is required for TTS players. Use getLanguageList and getDefaultLanguage methods to check the level of support before choosing the language to use for the next utterances.