when recording audio for video, keep the level constant

This commit is contained in:
Zeno Rogue 2020-05-25 23:59:12 +02:00
parent 14ecca8529
commit d5d6fd0f28
1 changed files with 4 additions and 0 deletions

View File

@ -236,6 +236,10 @@ void save_raw_audio() {
/* save the output as raw audio file */
/* (it can be added to the video using ffmpeg */
FILE *f = fopen("raw-audio.raw", "wb");
for(int i=0; i<curt; i++) for(int ch: {0,1})
to_play[i][ch] = sndbuffer[i][ch] / maxsnd * 30000;
fwrite(&to_play[0], 4, to_play.size(), f);
fclose(f);
}