MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / loadSoundFile

Function loadSoundFile

TheForceEngine/TFE_Asset/vocAsset.cpp:25–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23 bool parseVoc(SoundBuffer* voc);
24
25 bool loadSoundFile(const char* name)
26 {
27 FilePath filePath;
28 if (!TFE_Paths::getFilePath(name, &filePath))
29 {
30 return false;
31 }
32
33 FileStream vocAsset;
34 if (!vocAsset.open(&filePath, Stream::MODE_READ))
35 {
36 return false;
37 }
38 size_t size = vocAsset.getSize();
39 s_buffer.resize(size + 1);
40 vocAsset.readBuffer(s_buffer.data(), (u32)size);
41 vocAsset.close();
42
43 return true;
44 }
45
46 SoundBuffer* get(const char* name)
47 {

Callers 2

getFunction · 0.85
getIndexFunction · 0.85

Calls 7

dataMethod · 0.80
getFilePathFunction · 0.50
openMethod · 0.45
getSizeMethod · 0.45
resizeMethod · 0.45
readBufferMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected