MCPcopy Create free account
hub / github.com/adamstark/AudioFile / determineAudioFileFormat

Method determineAudioFileFormat

AudioFile.h:1215–1228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1213//=============================================================
1214template <class T>
1215AudioFileFormat AudioFile<T>::determineAudioFileFormat (const std::vector<uint8_t>& fileData)
1216{
1217 if (fileData.size() < 4)
1218 return AudioFileFormat::Error;
1219
1220 std::string header (fileData.begin(), fileData.begin() + 4);
1221
1222 if (header == "RIFF")
1223 return AudioFileFormat::Wave;
1224 else if (header == "FORM")
1225 return AudioFileFormat::Aiff;
1226 else
1227 return AudioFileFormat::Error;
1228}
1229
1230//=============================================================
1231template <class T>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected