TTSAgentProtocol
public protocol TTSAgentProtocol : CapabilityAgentable
The TTSAgent handles directives for controlling speech playback.
-
Returns the current time of the current player item.
This function retrieves the offset(seconds) of the current
MediaPlayablehandled by theTTSAgent.Declaration
Swift
var offset: Int? { get } -
The duration of the current player item.
This function retrieves the duration(seconds) of the current
MediaPlayablehandled by theTTSAgent.Declaration
Swift
var duration: Int? { get } -
The audio playback volume for the player.
This function retrieves the volume of the current
MediaPlayablehandled by theTTSAgent.Declaration
Swift
var volume: Float { get set } -
The cancellation policy when playback is implicitly stopped.
Declaration
Swift
var directiveCancelPolicy: DirectiveCancelPolicy { get set } -
Adds a delegate to be notified of
TTSStatechanges.Declaration
Swift
func add(delegate: TTSAgentDelegate)Parameters
delegateThe object to add.
-
Removes a delegate from
TTSAgent.Declaration
Swift
func remove(delegate: TTSAgentDelegate)Parameters
delegateThe object to remove.
-
Request voice synthesis and playback.
Declaration
Swift
@discardableResult func requestTTS( text: String, playServiceId: String?, handler: ((_ ttsResult: TTSResult, _ dialogRequestId: String) -> Void)? ) -> StringParameters
textThe obejct to request speech synthesis.
playServiceIdThe unique identifier to specify play service.
-
Stops playback
Declaration
Swift
func stopTTS(cancelAssociation: Bool)Parameters
cancelAssociationtrue: cancel all associated directives, false : only stop tts
-
requestTTS(text:Extension method) Request voice synthesis and playback.
Declaration
Swift
@discardableResult func requestTTS(text: String) -> StringParameters
textThe obejct to request speech synthesis.
-
requestTTS(text:Extension methodplayServiceId: ) <#Description#>
Declaration
Swift
@discardableResult func requestTTS(text: String, playServiceId: String?) -> StringParameters
text<#text description#>
playServiceId<#playServiceId description#>
Return Value
<#description#>
-
requestTTS(text:Extension methodhandler: ) <#Description#>
Declaration
Swift
@discardableResult func requestTTS(text: String, handler: ((_ ttsResult: TTSResult, _ dialogRequestId: String) -> Void)? = nil) -> StringParameters
text<#text description#>
handler<#handler description#>
Return Value
<#description#>
-
stopTTS()Extension methodStops playback
Declaration
Swift
func stopTTS()
View on GitHub
TTSAgentProtocol Protocol Reference