(function (global, factory) {
  if (typeof define === "function" && define.amd) {
    define(["exports", "buffer", "@aws-sdk/util-utf8-node", "@aws-sdk/eventstream-marshaller"], factory);
  } else if (typeof exports !== "undefined") {
    factory(exports, require("buffer"), require("@aws-sdk/util-utf8-node"), require("@aws-sdk/eventstream-marshaller"));
  } else {
    var mod = {
      exports: {}
    };
    factory(mod.exports, global.buffer, global.utilUtf8Node, global.eventstreamMarshaller);
    global.convertAudioToAWSBinaryMessage = mod.exports;
  }
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _buffer, _utilUtf8Node, _eventstreamMarshaller) {
  "use strict";

  Object.defineProperty(_exports, "__esModule", {
    value: true
  });
  _exports.default = void 0;
  _buffer = _interopRequireDefault(_buffer);

  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

  function getAudioEventMessage(pcmBuffer) {
    return {
      headers: {
        ':message-type': {
          type: 'string',
          value: 'event'
        },
        ':event-type': {
          type: 'string',
          value: 'AudioEvent'
        }
      },
      body: pcmBuffer
    };
  }

  const convertAudioToBinaryMessage = function convertAudioToBinaryMessage({
    audioBinary,
    _getAudioEventMessage = getAudioEventMessage,
    _marshaller = new _eventstreamMarshaller.EventStreamMarshaller(_utilUtf8Node.toUtf8, _utilUtf8Node.fromUtf8)
  }) {
    const pcmBuffer = audioBinary;

    const audioEventMessage = _getAudioEventMessage(pcmBuffer);

    const binary = _marshaller.marshall(audioEventMessage);

    return binary;
  };

  var _default = convertAudioToBinaryMessage;
  _exports.default = _default;
});
//# sourceMappingURL=convertAudioToAWSBinaryMessage.js.map