# Class Sound#setExternalSpeaker

Sound

- Defined in: sound.js

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| Sound#setExternalSpeaker(successCallback, errorCallback, options) Enable or disable external speaker.

## Class Detail

Sound#setExternalSpeaker(successCallback, errorCallback, options)
Enable or disable external speaker. If this method is successfully executed, change the external speaker status.

    // Javascript code
    function setExternalSpeaker () {
      var options = {
         externalSpeaker : true
      };

      function successCb() {
         // Do something
      }

      function failureCb(cbObject) {
         var errorCode = cbObject.errorCode;
         var errorText = cbObject.errorText;
         console.log ("Error Code [" + errorCode + "]: " + errorText);
      }

      var sound = new Sound();
      sound.setExternalSpeaker(successCb, failureCb, options);
    }

Parameters:
{Function} successCallback
  success callback function.
{Function} errorCallback
  failure callback function.
{Object} options

  Property | Type | Description | Required
  --- | --- | --- | ---
  | externalSpeaker | Boolean | true : enabled / false : disabled | required

Since:
  1.0
Returns:

  If the method is successfully executed, call the success callback function without a parameter. If an error occurs, failure callback function is called with failure callback object as a parameter.

See:
  Sound.getSoundStatus()