Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[raudio] check audio device state early #4122

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/raudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,12 @@ Sound LoadSoundFromWave(Wave wave)

if (wave.data != NULL)
{
if (ma_device_get_state(&AUDIO.System.device) == ma_device_state_uninitialized)
{
TRACELOG(LOG_WARNING, "SOUND: Audio device uninitialized");
return sound;
}

// When using miniaudio we need to do our own mixing
// To simplify this we need convert the format of each sound to be consistent with
// the format used to open the playback AUDIO.System.device. We can do this two ways:
Expand Down
Loading