nsSoundRequest::GetFileFormat(const char* inData, long inDataSize, const nsACString& contentType)
nsMovieSoundRequest::GetFileFormat(const char* inData, long inDataSize, const nsACString& contentType)
nsSoundRequest::GetFileFormat(const char* inData, long inDataSize, const nsACString& contentType){  OSType    fileFormat = kQTFileTypeMovie;    // Default to just treating it like a movie.                                              // Hopefully QuickTime will be able to import it.  if (inDataSize >= 16)  {    // look for WAVE    const char* dataPtr = inData;    if (*(OSType *)dataPtr == 'RIFF')    {      dataPtr += 4;     // skip RIFF      dataPtr += 4;     // skip length bytes      if (*(OSType *)dataPtr == 'WAVE')        return kQTFileTypeWave;    }        // look for AIFF    dataPtr = inData;    if (*(OSType *)dataPtr == 'FORM')    {      dataPtr += 4;     // skip FORM      dataPtr += 4;     // skip length bytes      if (*(OSType *)dataPtr == 'AIFF')        return kQTFileTypeAIFF;             if (*(OSType *)dataPtr == 'AIFC')        return kQTFileTypeAIFC;    }  }    if (inDataSize >= 4)  {    // look for midi    if (*(OSType *)inData == 'MThd')      return kQTFileTypeMIDI;        // look for Law/Next-Sun file format (.au)    if (*(OSType *)inData == '.snd')      return kQTFileTypeMuLaw;      }    // MP3 files have a complex format that is not easily sniffed. Just go by  // MIME type.  if (contentType.Equals("audio/mpeg")    ||      contentType.Equals("audio/mp3")     ||      contentType.Equals("audio/mpeg3")   ||      contentType.Equals("audio/x-mpeg3") ||      contentType.Equals("audio/x-mp3")   ||      contentType.Equals("audio/x-mpeg3"))  {    fileFormat = 'MP3 ';      // not sure why there is no enum for this  }      return fileFormat;}