For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Platform docsVideosCommunitySign up
CapabilitiesGetting startedVoice AI OrchestrationVoxEngine PlatformAPI ReferenceFAQ
CapabilitiesGetting startedVoice AI OrchestrationVoxEngine PlatformAPI ReferenceFAQ
      • Overview
        • Player
        • PlayerEvents
        • StreamingAgent
        • StreamingAgentEvents
        • SequencePlayer
        • SequencePlayerEvents
        • Recorder
        • RecorderDirection
        • RecorderEvents
        • RecorderLabelFont
        • RecorderLabelPosition
        • RecorderLabelTextAlign
        • RecorderLayout
        • RecorderObjectFit
        • RecorderProfile
        • RecordExpireTime
        • URLPlayerRequestMethod
  • Management API
    • Reference
    • Authorization
    • Errors
  • Web SDK
    • Overview
  • Android SDK
    • Overview
  • Android SDK v3
    • Overview
  • iOS SDK
    • Overview
  • React Native SDK
    • Overview
  • Flutter SDK
    • Overview
LogoLogo
Platform docsVideosCommunitySign up
On this page
  • Methods
  • activeAudioTrack
  • activeVideoTrack
  • addEventListener
  • audioTracks
  • id
  • removeEventListener
  • setActiveTrack
  • stop
  • videoTracks
VoxEngineMedia playback and recording

StreamingAgent

Represents a streaming object to interact with streaming platforms.
||View as Markdown|
Was this page helpful?
Edit this page
Previous

PlayerEvents

Next

StreamingAgentEvents

Built with

Represents a streaming object to interact with streaming platforms. Add the following line to your scenario code to use the class:

require(Modules.StreamingAgent);

Methods

activeAudioTrack

Gets the track ID of an active audio track or -1 if there is none.

1activeAudioTrack(): number

activeVideoTrack

Gets the track ID of an active video track or -1 if there is none.

1activeVideoTrack(): number

addEventListener

Adds a handler for the specified StreamingAgentEvents event. Use only functions as handlers; anything except a function leads to the error and scenario termination when a handler is called.

1addEventListener(event: StreamingAgentEvents | T, callback: (event: _StreamingAgentEvents[T]) => any): void

Parameters

event
StreamingAgentEvents | TRequired
callback
(event: _StreamingAgentEvents[T]) => anyRequired

audioTracks

Gets the list of all current audio tracks.

1audioTracks(): StreamingAgentTrack[]

id

Returns the StreamingAgent’s id.

1id(): string

removeEventListener

Removes a handler for the specified StreamingAgentEvents event.

1removeEventListener(event: StreamingAgentEvents | T, callback?: (event: _StreamingAgentEvents[T]) => any): void

Parameters

event
StreamingAgentEvents | TRequired
callback
(event: _StreamingAgentEvents[T]) => any

setActiveTrack

Sets a certain audio and/or video track as active. If an active video track is set, it is not replaced by the new one unlike in the default mode. Default mode: The active video track is the one that started sending data last. The active audio track is always the first one. To return to the default mode, set the track IDs equal to -1.

1setActiveTrack(tracks: { audioTrack?: number; videoTrack?: number }): void

Parameters

tracks
{ audioTrack?: number; videoTrack?: number }Required

stop

Stops streaming. Triggers the StreamStopped event. Do not call any other streaming methods after a StreamingAgent.stop call.

1stop(): void

videoTracks

Gets the list of all current video tracks.

1videoTracks(): StreamingAgentTrack[]