diff --git a/src/template.c b/src/template.c index 94c9c33..008ee19 100644 --- a/src/template.c +++ b/src/template.c @@ -131,13 +131,13 @@ main(void) bytebeat_res = signed_to_unsigned(bytebeat_res); // 3. convert audio data to sample - SAMPLE_TYPE sample_res = (SAMPLE_TYPE)bytebeat_res & + SAMPLE_TYPE sample_res = (SAMPLE_TYPE) bytebeat_res & BIT_DEPTH_LIMITER; // 4. if bit depth is less than 8, stretch it #if BIT_DEPTH < 8 sample_res = (SAMPLE_TYPE) - ((long double)buffer[w] * ((long double)BIT_DEPTH / 8.L)); + ((long double) buffer[w] * ((long double) BIT_DEPTH / 8.L)); #endif // 5. save sample into buffer @@ -151,7 +151,7 @@ main(void) "%sremaining samples = %18" PRIuMAX " (%.2Lf%% done)", ANSI_CLEAR, PRODUCT - w - 1, - (long double)w * 100 / (long double)PRODUCT); + (long double) w * 100 / (long double) PRODUCT); fflush(stdout); } #endif @@ -181,8 +181,10 @@ main(void) 5 * 4 /* 4 uint32_t values */ + 4 * 2 /* 5 uint16_t values */ + PRODUCT /* sample data */, - fmt_data_length = 16 /* length of format data before this value - in the file format structure */, + fmt_data_length = 16 /* + * length of format data before this value + * in the file format structure + */, sample_rate = SAMPLE_RATE, byte_rate = (SAMPLE_RATE * BIT_DEPTH * CHANNELS) / 8; uint16_t fmt_type = 1, // format type is PCM