services/text_to_speech/v1-corpus-builder.js
function Node (config) {
    RED.nodes.createNode(this, config);
    var node = this;

    this.on('input', function (msg) {
      var method = config['tts-custom-mode'],
        message = '',
        params = {};

      username = sUsername || this.credentials.username;
      password = sPassword || this.credentials.password || config.password;
      apikey = sApikey || this.credentials.apikey || config.apikey;

      endpoint = sEndpoint;
      if ((!config['default-endpoint']) && config['service-endpoint']) {
        endpoint = config['service-endpoint'];
      }

      if (!apikey && (!username || !password)) {
        message = 'Missing Watson Text to Speech service credentials';
      } else if (!method || '' === method) {
        message = 'Required mode has not been specified';
      } else {
        params = buildParams(msg, method, config);
      }

      if (message) {
        payloadutils.reportError(node, msg, message);
        return;
      }

      if (checkForFile(method)) {
        if (msg.payload instanceof Buffer) {
          loadFile(node, method, params, msg);
          return;
        }
        params = setFileParams(method, params, msg);
      }

      executeMethod(node, method, params, msg);
    });
  }
function Node (config) {
    RED.nodes.createNode(this, config);
    var node = this;

    this.on('input', function (msg) {
      var method = config['tts-custom-mode'],
        message = '',
        params = {};

      username = sUsername || this.credentials.username;
      password = sPassword || this.credentials.password || config.password;
      apikey = sApikey || this.credentials.apikey || config.apikey;

      endpoint = sEndpoint;
      if ((!config['default-endpoint']) && config['service-endpoint']) {
        endpoint = config['service-endpoint'];
      }

      if (!apikey && (!username || !password)) {
        message = 'Missing Watson Text to Speech service credentials';
      } else if (!method || '' === method) {
        message = 'Required mode has not been specified';
      } else {
        params = buildParams(msg, method, config);
      }

      if (message) {
        payloadutils.reportError(node, msg, message);
        return;
      }

      if (checkForFile(method)) {
        if (msg.payload instanceof Buffer) {
          loadFile(node, method, params, msg);
          return;
        }
        params = setFileParams(method, params, msg);
      }

      executeMethod(node, method, params, msg);
    });
  }
function Node ( config ) { RED . nodes . createNode ( this , config ) ; var node = this ; this . on ( 'input' , function ( msg ) { var method = config [ 'tts-custom-mode' ] , message = '' , params = { } ; username = sUsername || this . credentials . username ; password = sPassword || this . credentials . password || config . password ; apikey = sApikey || this . credentials . apikey || config . apikey ; endpoint = sEndpoint ; if ( ( ! config [ 'default-endpoint' ] ) && config [ 'service-endpoint' ] ) { endpoint = config [ 'service-endpoint' ] ; } if ( ! apikey && ( ! username || ! password ) ) { message = 'Missing Watson Text to Speech service credentials' ; } else if ( ! method || '' === method ) { message = 'Required mode has not been specified' ; } else { params = buildParams ( msg , method , config ) ; } if ( message ) { payloadutils . reportError ( node , msg , message ) ; return ; } if ( checkForFile ( method ) ) { if ( msg . payload instanceof Buffer ) { loadFile ( node , method , params , msg ) ; return ; } params = setFileParams ( method , params , msg ) ; } executeMethod ( node , method , params , msg ) ; } ) ; }
This is the Speech to Text V1 Query Builder Node
This is the Speech to Text V1 Query Builder Node