Class: OutgoingMessage

OutgoingMessage

Outgoing audio message class. Instances are returned from Session.startVoiceMessage method

Methods

start()

Starts an outgoing message if options.autoStart is true (default behaviour) then message is started automatically when instance is created by session.startVoiceMessage
Source:

stop(userCallback) → {Promise}

Stops outgoing message
Parameters:
Name Type Description
userCallback function user callback that is called when server stop_stream command is done
Source:
Returns:
promise that resolves when server stop_stream command is done
Type
Promise
Example
// callback
outgoingMessage.stop(function(err, result) {
  if (err) {
    console.trace(err);
    return;
  }
  console.warn('Message stopped');
});

// promise
outgoingMessage.then(function(result) {
  console.warn('Message stopped');
}).catch(function(err) {
  console.trace(err);
});

Events

data

Outgoing message pcm data from recorder is ready to be encoded
Parameters:
Name Type Description
data Float32Array pcm data portion
Source:

data_encoded

Outgoing message packet encoded and ready to be sent to zello server. Session is following this event and sends data automatically
Parameters:
Name Type Description
packet Uint8Array encoded opus packet with headers
Source: