fixed bug that changed the HOME env var inside the program
This commit is contained in:
@@ -21,16 +21,8 @@ int play_raw_audio(char file_name[]) {
|
||||
ss.rate = 48000;
|
||||
ss.channels = 2;
|
||||
|
||||
// Temporarily redirect stderr to /dev/null
|
||||
// because pulseaudio prints to stderr even though it does not set any error codes
|
||||
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);
|
||||
|
||||
// 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
|
||||
|
||||
Reference in New Issue
Block a user