Source: speech-to-text/content-type.js

'use strict';

// these are the only content-types currently supported by the speech-to-tet service
var contentTypes = {
  fLaC: 'audio/flac',
  RIFF: 'audio/wav',
  OggS: 'audio/ogg; codecs=opus'
};

/**
 * Takes the beginning of an audio file and returns the associated content-type / mime type
 *
 * @param {String} header first 4 characters of the file as a UTF-8 string
 * @return {String|undefined} - the contentType of undefined
 */
module.exports = function contentType(header) {
  return contentTypes[header];
};