From 9ec002c216caaa9cb6a24f80b1c9935e894dfd76 Mon Sep 17 00:00:00 2001 From: bjoernf Date: Wed, 16 Aug 2023 22:51:00 +0200 Subject: [PATCH] fixed indentation --- play_raw_audio.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/play_raw_audio.c b/play_raw_audio.c index 22ecf65..4773781 100644 --- a/play_raw_audio.c +++ b/play_raw_audio.c @@ -10,9 +10,9 @@ int play_raw_audio(char file_name[]) { int pa_error = 0; - char content[1024] = ""; + char content[1024] = ""; - int myfd = open(file_name, O_RDONLY); + int myfd = open(file_name, O_RDONLY); if (myfd == -1) { perror("Failed to open audio file"); return 1; @@ -29,26 +29,25 @@ int play_raw_audio(char file_name[]) { FILE *original_stderr = stderr; stderr = fopen("/dev/null", "w"); - simple = pa_simple_new(NULL, "Audio Playback", PA_STREAM_PLAYBACK, NULL, "playback", &ss, NULL, NULL, &pa_error); + simple = pa_simple_new(NULL, "Audio Playback", PA_STREAM_PLAYBACK, NULL, "playback", &ss, NULL, NULL, &pa_error); // Restore stderr stderr = original_stderr; int i = 0; - while (read(myfd, content, sizeof(content))) { - // skip the first 1024 bytes to not play the file header - if (i != 0) { - pa_simple_write(simple, content, sizeof(content), &pa_error); - } - i++; - } + while (read(myfd, content, sizeof(content))) { + // skip the first 1024 bytes to not play the file header + if (i != 0) { + pa_simple_write(simple, content, sizeof(content), &pa_error); + } + i++; + } - pa_simple_drain(simple, NULL); + pa_simple_drain(simple, NULL); - pa_simple_free(simple); + pa_simple_free(simple); - close(myfd); + close(myfd); - return 0; + return 0; } -