Detect audio file size anomalies in source folder
If a file is smaller than the expected size for the bitrate settings of the source file, than cause an alert.
Why?
The recording program may have had some random error.
That includes errors at either the AudioServer, or the station's own audio recording tool.
Emit error?
Emit an error event?
Error: Filesize smaller than expected: [audio-file-name.mp3 - size: 2 MB] [Expected: 57 MB]
Ideas for handling filesize detection
-
Figure out codec and bitrate of the files.
- Example: 128kbit/s Constant Bitrate MP3
-
Figure out intended file durations based on filenames of at least 2 files, using something like
moment()
's time difference feature, or another method.- Example: 1 hour
-
Based on codec's bitrate and intended duration, figure out the expected length of the file.
-
If the file has not been written to in a while (1+ minute?) then consider that file "done" and count it among the checked files.
-
If file is considerably smaller than expected length, then emit an error.
128kbit/s * 1 hour = 57.6 MB