MumbleConnection - Rantanen/node-mumble GitHub Wiki

Functions

MumbleConnection(socket, options)

Mumble connection

encodeVersion(major, minor, patch)number

Encodes the version to an uint8 that can be sent to the server for version-exchange

MumbleConnection(socket, options)

Params

  • socket Socket - SSL socket connected to the server.
  • options Object - Connection options.

Mumble connection

mumbleConnection.authenticate(name, password, tokens)

Params

  • name string - Username
  • password string - User password
  • tokens Array.<string> - Access tokens

Authenticate the user

mumbleConnection.disconnect()

Disconnects the client from Mumble

mumbleConnection.initialize()

Send the static init information

mumbleConnection.inputStream(options)

Params

  • options Object - Input stream options

Returns: MumbleInputStream - Input stream.

Returns a new input stream for audio.

mumbleConnection.joinPath(path)

Params

  • path string - Path to join.

Join a channel specified by a Mumble URL

mumbleConnection.outputStream(userSession, noEmptyFrames)

Params

  • userSession number - Optional user session ID. If omitted the output stream will receive the mixed audio output for all users.
  • noEmptyFrames bool - Enable or disable emitting empty frames for silence.

Returns: MumbleOutputStream - Output stream.

Returns a new output stream for audio.

mumbleConnection.sendEncodedFrame(packets, codec, [whisperTarget], [voiceSequence])

Send encoded voice frames.

Params

  • packets Buffer - Encoded frames.
  • codec number - Audio codec number for the packets.
  • [whisperTarget] number - Optional whisper target ID. Defaults to null.
  • [voiceSequence] number - Voice packet sequence number. Required when multiplexing several audio streams to different users.

Returns: number - Amount of frames sent.

mumbleConnection.sendMessage(type, data)

Params

  • type string - Message type ID
  • data Object - Message data

Send a protocol message

mumbleConnection.sendVoice(chunk, whisperTarget)

Params

  • chunk Buffer - PCM audio data in 16bit unsigned LE format.
  • whisperTarget number - Optional whisper target ID.

Send voice data to the server.

TODO: Add a flush timeout to flush remaining audio data if the buffer contains remnant data.

mumbleConnection.sendVoiceFrame(frame, [whisperTarget], [voiceSequence])

Send a voice frame.

Params

  • frame Buffer - Voice frame. The buffer must be the size of a one frame. Use sendVoice to send arbitrary length buffers.
  • [whisperTarget] number - Optional whisper target ID. Defaults to null.
  • [voiceSequence] number - Voice packet sequence number. Required when multiplexing several audio streams to different users.

Returns: Buffer - Frames sent

encodeVersion(major, minor, patch)

Params

  • major number - Major version.
  • minor number - Minor version.
  • patch number - Patch number.

Returns: number - 32-bit encoded version number.

Encodes the version to an uint8 that can be sent to the server for version-exchange

⚠️ **GitHub.com Fallback** ⚠️