71b42e31bd
Put takes a []byte, so storing a recording meant the whole recording in memory. A two hour meeting at 16 kHz mono is about 230 MB of WAV, and building it from PCM held a second copy of the same size in the process that also owns the database and the resident model. PutFile stats the file, hashes it in a stream and renames it into place, so the peak is one buffer regardless of length. SpoolFile hands out the scratch file it moves from, under the media dir so it shares the same disk and the same permissions. Audio also gets its own per blob cap of 512 MiB. The image cap of 64 MiB is 35 minutes of audio, which contradicted the two hour session cap: the long meeting was exactly the one that failed to store. audio.WAVHeader is split out of WAVFromPCM because a spooled capture writes a placeholder header first and stamps the real length at the end. Found in review of #73.