Good to do this you will need to know some attributes about the audio to be transmitted, as if the audio is mp3 (there is compression) or sera PCM (no compression), files of this type are the known wav, You need to know if the transmission will be in mono or stereo beyond the frame rate and at what bit rate the audio transmission is being done, with this information you can accurately calculate the size of your audio in any second / millisecond, to know the total size of the file, look at the following answer #
In other words, when calculating how many seconds / minutes your file has, you can calculate its total size as well.
For mp3 in mono the general formula is as follows:
Taxa de bits do seu audio / 8
This will be equal to how many bytes per second it was received, ie if the file touched a second will be the value of this calculation, now add that to accumulate with each second played.
If you have achieved the full size of your file in seconds then to know the total size in bytes follow the general formula again.
Taxa de bits do seu audio / 8 × X segundos do seu áudio
Remember that if it is stereo transmission then two channels are used and in these cases make the result times 2.