summaryrefslogtreecommitdiff
path: root/apps/plugins/wavplay.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/wavplay.c')
-rw-r--r--apps/plugins/wavplay.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/apps/plugins/wavplay.c b/apps/plugins/wavplay.c
index 2d88ebc40d..faa5b0861a 100644
--- a/apps/plugins/wavplay.c
+++ b/apps/plugins/wavplay.c
@@ -3465,7 +3465,7 @@ int play_file(char* filename)
3465 fd = rb->open(filename, O_RDONLY); 3465 fd = rb->open(filename, O_RDONLY);
3466 if (fd < 0) 3466 if (fd < 0)
3467 { 3467 {
3468 rb->splash(2*HZ, true, "Couldn't open WAV file"); 3468 rb->splash(2*HZ, "Couldn't open WAV file");
3469 return PLAY_ERROR; 3469 return PLAY_ERROR;
3470 } 3470 }
3471 3471
@@ -3474,13 +3474,13 @@ int play_file(char* filename)
3474 got = rb->read(fd, aud_buf, wanted); /* wav header */ 3474 got = rb->read(fd, aud_buf, wanted); /* wav header */
3475 if (got < 0) 3475 if (got < 0)
3476 { 3476 {
3477 rb->splash(2*HZ, true, "Read error"); 3477 rb->splash(2*HZ, "Read error");
3478 rb->close(fd); 3478 rb->close(fd);
3479 return PLAY_ERROR; 3479 return PLAY_ERROR;
3480 } 3480 }
3481 else if (got < wanted) 3481 else if (got < wanted)
3482 { 3482 {
3483 rb->splash(2*HZ, true, "File too short"); 3483 rb->splash(2*HZ, "File too short");
3484 rb->close(fd); 3484 rb->close(fd);
3485 return PLAY_ERROR; 3485 return PLAY_ERROR;
3486 } 3486 }
@@ -3490,7 +3490,7 @@ int play_file(char* filename)
3490 || rb->memcmp(aud_buf + 12, "fmt ", 4) 3490 || rb->memcmp(aud_buf + 12, "fmt ", 4)
3491 || rb->memcmp(aud_buf + 36, "data", 4)) 3491 || rb->memcmp(aud_buf + 36, "data", 4))
3492 { 3492 {
3493 rb->splash(2*HZ, true, "No canonical WAV file"); 3493 rb->splash(2*HZ, "No canonical WAV file");
3494 rb->close(fd); 3494 rb->close(fd);
3495 return PLAY_ERROR; 3495 return PLAY_ERROR;
3496 } 3496 }
@@ -3498,7 +3498,7 @@ int play_file(char* filename)
3498 format = letoh16(*(uint16_t *)(aud_buf + 20)); 3498 format = letoh16(*(uint16_t *)(aud_buf + 20));
3499 if (format != 1) 3499 if (format != 1)
3500 { 3500 {
3501 rb->splash(2*HZ, true, "Unsupported format: %d", format); 3501 rb->splash(2*HZ, "Unsupported format: %d", format);
3502 rb->close(fd); 3502 rb->close(fd);
3503 return PLAY_ERROR; 3503 return PLAY_ERROR;
3504 } 3504 }
@@ -3506,7 +3506,7 @@ int play_file(char* filename)
3506 channels = letoh16(*(uint16_t *)(aud_buf + 22)); 3506 channels = letoh16(*(uint16_t *)(aud_buf + 22));
3507 if (channels > 2) 3507 if (channels > 2)
3508 { 3508 {
3509 rb->splash(2*HZ, true, "Too many channels: %d", channels); 3509 rb->splash(2*HZ, "Too many channels: %d", channels);
3510 rb->close(fd); 3510 rb->close(fd);
3511 return PLAY_ERROR; 3511 return PLAY_ERROR;
3512 } 3512 }
@@ -3514,7 +3514,7 @@ int play_file(char* filename)
3514 samplebits = letoh16(*(uint16_t *)(aud_buf + 34)); 3514 samplebits = letoh16(*(uint16_t *)(aud_buf + 34));
3515 if (samplebits != 16) 3515 if (samplebits != 16)
3516 { 3516 {
3517 rb->splash(2*HZ, true, "Unsupported sample depth: %dbit", samplebits); 3517 rb->splash(2*HZ, "Unsupported sample depth: %dbit", samplebits);
3518 rb->close(fd); 3518 rb->close(fd);
3519 return PLAY_ERROR; 3519 return PLAY_ERROR;
3520 } 3520 }
@@ -3532,7 +3532,7 @@ int play_file(char* filename)
3532 case 44100: rate = 9; break; 3532 case 44100: rate = 9; break;
3533 case 48000: rate = 10; break; 3533 case 48000: rate = 10; break;
3534 default: 3534 default:
3535 rb->splash(2*HZ, true, "Unsupported samplerate: %dHz", samplerate); 3535 rb->splash(2*HZ, "Unsupported samplerate: %dHz", samplerate);
3536 rb->close(fd); 3536 rb->close(fd);
3537 return PLAY_ERROR; 3537 return PLAY_ERROR;
3538 } 3538 }
@@ -3655,14 +3655,14 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
3655 3655
3656 if (!parameter) 3656 if (!parameter)
3657 { 3657 {
3658 rb->splash(HZ, true, "Play WAV file!"); 3658 rb->splash(HZ, "Play WAV file!");
3659 return PLUGIN_OK; 3659 return PLUGIN_OK;
3660 } 3660 }
3661 3661
3662 plug_buf = rb->plugin_get_buffer(&buf_size); 3662 plug_buf = rb->plugin_get_buffer(&buf_size);
3663 if (buf_size < 6700) /* needed for i2c transfer */ 3663 if (buf_size < 6700) /* needed for i2c transfer */
3664 { 3664 {
3665 rb->splash(HZ, true, "Out of memory."); 3665 rb->splash(HZ, "Out of memory.");
3666 return PLUGIN_ERROR; 3666 return PLUGIN_ERROR;
3667 } 3667 }
3668 3668