Available Space Left for Recording Audio

********** AllStarLink [ASL] Version Info **********

OS : Debian GNU/Linux 12 (bookworm)
OS Kernel : 6.12.62+rpt-rpi-v8

Asterisk : 22.7.0+asl3-3.7.1-1.deb12
ASL [app_rpt] : 3.7.1

Will someone please tell me how much available space I have left for recording audio in wav49 format?

I’m wanting to record nets that may stretch out for 2-3 hours.

Filesystem Size Used Avail Use% Mounted on
udev 319M 0 319M 0% /dev
tmpfs 182M 20M 163M 11% /run
/dev/mmcblk0p2 29G 4.2G 24G 16% /
tmpfs 454M 0 454M 0% /dev/shm
tmpfs 5.0M 12K 5.0M 1% /run/lock
tmpfs 128M 0 128M 0% /tmp
tmpfs 32M 1.5M 31M 5% /var/log/apache2
tmpfs 32M 1.2M 31M 4% /var/log/asterisk
tmpfs 128M 0 128M 0% /var/tmp
/dev/mmcblk0p1 510M 58M 453M 12% /boot/firmware
tmpfs 91M 0 91M 0% /run/user/1000

Inquiry

See https://allstarlink.github.io/user-guide/troubleshooting/ on how to ask a good question to obtain the quickest and best assistance

looks like 24GB to me. don't know how wav49 grows per minute, though.

Ok, thanks. 1 hour of mono WAV audio: ~680 MB (using 1 channel), so hopefully wav49 is around the same disk consumption. With 24G available, I should have no problems recording a 3 hour net. I will be purging the record directory after each use.

wav49 is supposed to use the gsm codec and offer compression, or so i read while trying to find the file size estimator for that format.

is it possible your ~680 MB/hr is based on float or 32-bit samples at a sample rate much higher than necessary?

and, yes, 24GB seems fairly roomy for one channel audio recording to me

Well, I queried a search engine for disk consumption per hour for a standard .wav file format. the response was general in nature, and they didn’t state anything about sample rate. Yes, that could be a major factor, and also coupled with compression as you have expressed. I do have mono in my favor, as opposed to stereo.

Remember that you are dealing with 8 kHz sampling rate audio, so even if you use linear PCM, that’s only 128 kilobits per second. So one hour of that is only about 56.25 Mb, and it isn’t compromised like GSM wav49 is.

BTW, wav49’s bitrate is 13 kbps. So, let’s assume that, for some reason, you want to use this format instead of 16-bit linear PCM. With your free space, assuming nothing else changes, you could record using that bitrate for just a little over 6 months, or around 189 days, 15 hours, 55 minutes. This is all heavily rounded.

If you record using the much higher quality linear PCM instead, your total record time with that same free space goes down to about 19 days, 6 hours, 18 minutes, because 16-bit linear PCM at 8 kHz is a bit more than 9.8 times larger than wav49.

None of this accounts for any changes, such as log files being written to the 32GB storage, additional packages being installed, etc. but this should give you an idea.

Also note that if you are using archiveaudio to record nets, you will get a directory of individual files. If you want to store each net as a single audio file, you will have to concatenate all of the files you recorded to a single file. There are several different ways to achieve this. Lately, I have been using ls -p to list all wave files in a directory, and feeding that to SoX as stdin with the -combine concatenate parameter to write a new wave file.

I’m not looking at the moment, but I think it would be something like:

sox --combine concatenate ls -p /path/to/archive/directory/*.wav /path/to/save/archive/net.wav

Patrick, thank you for the information. It is very much appreciated. For now, I will record using all defaults with archiveaudio. I have learned to use Audacity to import all of the individual files, align all of the tracks end to end, mix and render all tracks into a single track, and export as .mp3 file format. It plays well. I will copy your reply into my docs file for further use. 73

Just FYI:

GSM audio is already very compressed and full of artifacts. If you convert that to MP3, you are adding even more transcoding on top and increasing the file size. If, however, you use PCM wave instead of wav49, you will get no artifacts, and the resulting wave file will be the same size as a 128KBPS MP3 if also saved in 16 bit linear PCM, 8 kHz mono. You can even cut that in half without anything noticeable if you save as G711 ulaw wav from the PCM source files, which you can do with both audacity and SoX. This will give you a 64KVPS file that still does not have the artifacts present when generating wav49, then up sampling and transcoding to MP3. One hour at this bit rate is around 28 megabytes, and, for all intense and purposes, it will maintain the original quality straight from the node.

I am an audio guy by trade, so I think about this sort of stuff all the time.

There used to be an option to save raw ulaw archives, which is what I did for a long time, then use SoX to generate a properly formatted g711 wave file. To avoid actually writing anything to the microSD card, I did all of this in /tmp, which was in RAM, then used SCP or SFTP to download the generated archive direct from RAM to another machine, so the card was never touched. This means I have a lot less free space to work with, but also, unless I forget about it for a few days, the power goes out while recording,or I'm doing something very memory intensive, that doesn't really matter too much. All this was done on a Raspberry Pi with one GB of RAM at the time.