View source: R/audio_filesize.R
audio_filesize | R Documentation |
Calculates the raw size of audio date at set sample rate, bit depth and duration.
audio_filesize(
samp.rate = 44100,
bit.depth = 16,
channels = 1,
duration = 1,
duration.unit = "seconds",
output.unit = "bits"
)
samp.rate |
Sample rate |
bit.depth |
Bit depth |
channels |
The number of audio channels |
duration |
Duration of recording |
duration.unit |
One of seconds, minutes, hours, days |
output.unit |
"human", "bits" or "bytes" |
By default humanBytes()
is used to convert the output to human readable format,
however this can be changed by setting output.unit
to "bits" or "bytes".
The size of the audio file in the specified unit
# One minute of mono 16-bit audio sampled at 44.1kHz
audio_filesize(samp.rate=44100, bit.depth=16, channels=1, duration=1, duration.unit="minutes")
# One year of stereo 24-bit audio sampled at 96kHz
audio_filesize(samp.rate=96000, bit.depth=24, channels=2, duration=1, duration.unit="years")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.