Skip to main content
Version: Current

Audio Actions

  • BeginRecordingAction

    An event that is used to start audio recording.

    Members

    • audio (boolean | ("screen" | "microphone")[])

      Whether to record audio.

      If the computer does not have an audio device attached, then setting this to true will cause an error.

      If an array is specified, only the specified audio sources will be recorded.

      Defaults to true.

    • audioBitsPerSecond? number

      The ideal number of bits per second that the audio portion of the recording should use. If omitted then a bitrake of 48kbps will be used.

      See https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/MediaRecorder#audiobitspersecond for more information.

    • bitsPerSecond? number

      The ideal number of bits per second that the recording should use. If omitted, then the videoBitsPerSecond and audioBitsPerSecond settings will be used.

      See https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/MediaRecorder#bitspersecond for more information.

    • mimeType? string

      The MIME type that should be produced. If supported, then the recorded file(s) will be in this format. If not supported, then the recording will fail. If not provided, then a default will be used.

      See https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Video_codecs for more information.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • screen boolean

      Whether to record the screen.

      Defaults to false.

    • taskId (string | number)

      The ID of the async task.

    • type "begin_recording"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

    • video boolean

      Whether to record video.

      If the computer does not have a video device attached (like a web cam), then setting this to true will cause an error.

      Defaults to true.

    • videoBitsPerSecond? number

      The ideal number of bits per second that the video portion of the recording should use. If omitted, then a bitrate of 1mbps will be used.

      See https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/MediaRecorder#videobitspersecond for more information.

  • BufferSoundAction

    Defines an event that is used to pre-load a sound from the given URL.

    Members

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "buffer_sound"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

    • url string

      The URL to buffer.

  • CancelSoundAction

    Defines an event that is used to cancel a sound that is playing.

    Members

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • soundID (string | number)

      The ID of the sound.

    • taskId (string | number)

      The ID of the async task.

    • type "cancel_sound"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • EndRecordingAction

    An event that is used to finish audio recording.

    Members

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "end_recording"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • GetVoicesAction

    An event that is used to retrieve the synthetic voices that are supported by the current system.

    Members

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "get_voices"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • PlaySoundAction

    Defines an event that is used to play a sound from the given url.

    Members

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • soundID (string | number)

      The ID of the sound.

    • taskId (string | number)

      The ID of the async task.

    • type "play_sound"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

    • url string

      The URL to open.

  • SpeakTextAction

    An event that is used to speak some text using the builtin text to speech engine.

    Members

    • pitch? number

      The pitch that the text should be spoken at.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • rate? number

      The rate that the text should be spoken at.

    • taskId (string | number)

      The ID of the async task.

    • text string

      The text that should be spoken.

    • type "speak_text"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

    • voice? string

      The name of the voice that the text should be spoken with.