The size of a sound file is calculated using the following formula:
size (in bits) = sampling rate sample resolution seconds
To calculate the size in bytes, the number is divided by 8
The algorithm in Figure 12, represented using pseudocode, should output the size of a sound file in bytes that has been sampled 100 times per second, with a sample resolution of 16 bits and a recording length of 60 seconds.
A subroutine called getSize
has been developed as part of the algorithm.
Complete Figure 12 by filling in the gaps using the items in Figure 11.
You will not need to use all the items in Figure 11.
Figure 11
bit
| byte
| getSize
| OUTPUT
|
rate
| res
| RETURN
| sampRate
|
seconds
| size
| size + 8
| size * 8
|
size / 8
| size MOD 8
| SUBROUTINE
| USERINPUT
|
Figure 12
SUBROUTINE getSize(____________, ____________, seconds)
______________ ← sampRate * res * seconds
size ← ______________
______________ size
ENDSUBROUTINE
OUTPUT ______________(100, 16, 60)