emulate audio system without audio daemon (#74)

This commit is contained in:
Nikita Savyolov 2024-09-25 14:54:28 +03:00 committed by GitHub
parent 32cd68e746
commit 0d4ed51cd9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 75 additions and 5 deletions

View file

@ -198,7 +198,10 @@ private:
SOX_SAMPLE_LOCALS;
while (!exit.load(std::memory_order::relaxed)) {
std::this_thread::sleep_for(std::chrono::milliseconds(1));
if (params->control == 0) {
std::this_thread::sleep_for(std::chrono::microseconds(10));
continue;
}
if (!params->formatIsFloat) {
auto data = reinterpret_cast<const std::int16_t *>(audioBuffer);
@ -216,11 +219,11 @@ private:
ORBIS_LOG_ERROR("AudioOut: sox_write failed");
}
// skip sceAudioOutMix%x event
info.evf->set(bitPattern);
// set zero to freeing audiooutput
params->control = 0;
// skip sceAudioOutMix%x event
info.evf->set(bitPattern);
}
sox_close(output);