template.c: reformat
This commit is contained in:
parent
918361489c
commit
b50915aed6
@ -131,13 +131,13 @@ main(void)
|
|||||||
bytebeat_res = signed_to_unsigned(bytebeat_res);
|
bytebeat_res = signed_to_unsigned(bytebeat_res);
|
||||||
|
|
||||||
// 3. convert audio data to sample
|
// 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;
|
BIT_DEPTH_LIMITER;
|
||||||
|
|
||||||
// 4. if bit depth is less than 8, stretch it
|
// 4. if bit depth is less than 8, stretch it
|
||||||
#if BIT_DEPTH < 8
|
#if BIT_DEPTH < 8
|
||||||
sample_res = (SAMPLE_TYPE)
|
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
|
#endif
|
||||||
|
|
||||||
// 5. save sample into buffer
|
// 5. save sample into buffer
|
||||||
@ -151,7 +151,7 @@ main(void)
|
|||||||
"%sremaining samples = %18" PRIuMAX " (%.2Lf%% done)",
|
"%sremaining samples = %18" PRIuMAX " (%.2Lf%% done)",
|
||||||
ANSI_CLEAR,
|
ANSI_CLEAR,
|
||||||
PRODUCT - w - 1,
|
PRODUCT - w - 1,
|
||||||
(long double)w * 100 / (long double)PRODUCT);
|
(long double) w * 100 / (long double) PRODUCT);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -181,8 +181,10 @@ main(void)
|
|||||||
5 * 4 /* 4 uint32_t values */ +
|
5 * 4 /* 4 uint32_t values */ +
|
||||||
4 * 2 /* 5 uint16_t values */ +
|
4 * 2 /* 5 uint16_t values */ +
|
||||||
PRODUCT /* sample data */,
|
PRODUCT /* sample data */,
|
||||||
fmt_data_length = 16 /* length of format data before this value
|
fmt_data_length = 16 /*
|
||||||
in the file format structure */,
|
* length of format data before this value
|
||||||
|
* in the file format structure
|
||||||
|
*/,
|
||||||
sample_rate = SAMPLE_RATE,
|
sample_rate = SAMPLE_RATE,
|
||||||
byte_rate = (SAMPLE_RATE * BIT_DEPTH * CHANNELS) / 8;
|
byte_rate = (SAMPLE_RATE * BIT_DEPTH * CHANNELS) / 8;
|
||||||
uint16_t fmt_type = 1, // format type is PCM
|
uint16_t fmt_type = 1, // format type is PCM
|
||||||
|
Loading…
Reference in New Issue
Block a user