MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / loadSoundFromWaveMemory

Function loadSoundFromWaveMemory

src/OpenLoco/src/Audio/Audio.cpp:46–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44 static void playSound(SoundId id, ChannelId channel, const World::Pos3& loc, int32_t volume, int32_t pan, int32_t frequency);
45
46 static BufferId loadSoundFromWaveMemory(const WAVEFORMATEX& format, const void* pcm, size_t pcmLen)
47 {
48 AudioFormat fmt{};
49 fmt.sampleRate = format.nSamplesPerSec;
50 fmt.channels = format.nChannels;
51 fmt.bitsPerSample = format.wBitsPerSample;
52 return loadBuffer(std::span<const uint8_t>(reinterpret_cast<const uint8_t*>(pcm), pcmLen), fmt);
53 }
54
55 static std::vector<BufferId> loadSoundsFromCSS(const fs::path& path)
56 {

Callers 2

loadSoundsFromCSSFunction · 0.85
getSoundBufferFunction · 0.85

Calls 1

loadBufferFunction · 0.85

Tested by

no test coverage detected