1
0

template.c: reformat

This commit is contained in:
Intel A80486DX2-66 2024-01-09 15:42:43 +03:00
parent 918361489c
commit b50915aed6
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -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