template.c: simplify file_length
calculation
This commit is contained in:
parent
f1f5c2a859
commit
ba5d489352
@ -181,14 +181,11 @@ main(void)
|
||||
// 2. prepare variables
|
||||
uint32_t buffer_size = PRODUCT,
|
||||
file_length =
|
||||
4 * 4 /* 4 strings of 4 characters */ +
|
||||
5 * 4 /* 5 uint32_t values */ +
|
||||
4 * 2 /* 4 uint16_t values */ +
|
||||
PRODUCT /* sample data */
|
||||
|
||||
/* subtract Subchunk2 headers: */
|
||||
- 4 /* a string of 4 characters */
|
||||
- 4 /* a uint32_t value */,
|
||||
/* file length without "RIFF" chunk */
|
||||
3 * 4 /* 3 strings of 4 characters: "WAVE", "fmt ", "data" */ +
|
||||
4 * 4 /* 4 uint32_t values */ +
|
||||
4 * 2 /* 4 uint16_t values */ +
|
||||
PRODUCT /* sample data */,
|
||||
fmt_data_length = 16 /* <--
|
||||
* length of format data before this value
|
||||
* in the file format structure
|
||||
|
Loading…
Reference in New Issue
Block a user