chore(build): containers, toolchains and portability fixes
This commit is contained in:
1 parent
f8e183b7ab
commit
774df0fd1e
1 file changed
+7
-3
@@ -263,6 +263,7 @@ class AudioDevice
|
||||
HWAVEOUT wave{};
|
||||
WAVEHDR header{};
|
||||
WAVEFORMATEX format{};
|
||||
std::vector<PcmSample> playback;
|
||||
bool prepared{false};
|
||||
#endif
|
||||
};
|
||||
@@ -343,11 +344,14 @@ class AudioDevice
|
||||
"waveOutOpen failed"}};
|
||||
}
|
||||
voice.header = WAVEHDR{};
|
||||
// waveOut only reads the samples, but WAVEHDR exposes a mutable
|
||||
// buffer; keep an owned mutable copy instead of casting away
|
||||
// constness of the shared buffer.
|
||||
voice.playback = voice.buffer->samples;
|
||||
voice.header.lpData =
|
||||
reinterpret_cast<LPSTR>(
|
||||
const_cast<PcmSample*>(voice.buffer->samples.data()));
|
||||
reinterpret_cast<LPSTR>(voice.playback.data());
|
||||
voice.header.dwBufferLength = static_cast<DWORD>(
|
||||
voice.buffer->samples.size() * sizeof(PcmSample));
|
||||
voice.playback.size() * sizeof(PcmSample));
|
||||
if (::waveOutPrepareHeader(voice.wave, &voice.header,
|
||||
sizeof(WAVEHDR)) !=
|
||||
MMSYSERR_NOERROR) {
|
||||
|
||||
Reference in new issue
Block a user