mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:57:35 +00:00
LibAudio/aplay: Handle WAV header errors properly
We shouldn't just ASSERT() if the header parse fails. This was crashing Piano completely.
This commit is contained in:
parent
4ad96df0d4
commit
d55d2b2794
2 changed files with 7 additions and 2 deletions
|
@ -41,6 +41,10 @@ int main(int argc, char** argv)
|
|||
auto audio_client = Audio::ClientConnection::construct();
|
||||
audio_client->handshake();
|
||||
Audio::WavLoader loader(argv[1]);
|
||||
if (loader.has_error()) {
|
||||
fprintf(stderr, "Failed to load WAV file: %s\n", loader.error_string());
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("\033[34;1m Playing\033[0m: %s\n", argv[1]);
|
||||
printf("\033[34;1m Format\033[0m: %u Hz, %u-bit, %s\n",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue