you can use Pd's [writesf~] to write to disk and then [readsf~] to open the file again once you stop recording and are ready to play back. The randomization has to be implemented in Pd, you'll probably need to keep a list of existing filenames (or numbers, if the file name can be reconstructed from a numerical ID) and then use the [random] object to get a pseudo-random number.

Is it possible to play 5-8 different streams of audio while still allowing recording to happen.

ie:
Microphone has a record button. When button pushed, record audio to .wav in folder
while also at the same time, running this logic:
Load files -> Make list -> Pick random -> Play random on speaker [0-7]

sure, I see no problem with that. How long are the files btw and do you need them stored on disk? If they are smaller than approx 200 MB total (approx 1200 seconds total in mono, or half that in stereo), then you could just store each recording in RAM in an array using [tabwrite~] and play it back using [tabplay~]. All of this without ever writing anything to disk.

They can be as low as possible, just a single voice talking. But there could be 300+ recordings happening over the space of 10 hours

well the issue is whether you need to store the recordings for all the 10 hours. If you need to store more than about 1200 seconds (20 minutes) of mono audio , then you'll need to use readsf~ / writesf~

Ideally, i'd love to save all the audio so every day I can offload what was recorded for archival purposes.

Can you record / playback at the same time? or is there an overload issue

Just to follow this up.

There is also SuperCollider available, which means there is an alternative, so the same question applies above, but now i'd like to add:

given the scope of being able to live record to file and readback the files on a loop, which would be better suited, PD or SC?

I have no idea, but I know nothing about Supercollider, so if my help you need, better stick to Pd!

hahaha 😃 ok ok - I just need a good starting point for recording from an audio source based on a threshold, then wait until the threshold has gone back down again for X amount of seconds before saving that clip to a file somewhere.

I would probably use one or more [bp~] to isolate the frequencies of interest, going into [env~ 8192] to get the RMS value over a reasonably large window, then into a [lop~] with a low enough cutoff to transform it back to signal and add a bit more smoothing, then into a properly tuned [threshold~], which will output two bangs, one on the left when the signal goes above the higher threshold, one on the right when the signal goes back below the lower threshold. The left bang can be used to start the recording if it's not started already, the right bang probably needs to go into some [delay] to make sure that the recording doesn't stop immediately when the signal goes quieter (you wouldn't want it to stop in between words, for instance). The [delay] should be disabled after you receive a left bang and are waiting for a right bang.
Once you have it basically working, you'll spend some time tuning the input filter, the threshold~ levels and the delay times.

Something like this
alt text

Looking that this, this is a good way to convert audio to a bang, but wouldn't it be recording zero audio from the adc after the env?

there's no audio going into [writesf~] in that example, you can send to it directly from [adc~]

How would you go about opening these files at the same time and playing them on dac 1 2 3 4 5 6 etc.

You want to play each wave file out of a different audio output?
Opening files is done by sending an [open( command to [readsf~], see its help file for details.

    giuliomoro Yeah, so based on your idea above, I've got a PD that is saving unique files when the trigger hits that threshold.

    Now I want to do something that I don't think is possible

    I want to load the files into 8 different speakers randomly, both random speaker and random file. I can't find anything about opening random files that doesn't use [shell], which I can't get working via Bela

    any ideas?

    You should name the files according to a fixed pattern (e.g.: myfile-X.wav, where X is a number). Then you use [random] to pick a random number in the valid range and feed it to [makefilename] to generate a valid file name that you then pass via [open ...( to [readsf~]. Regarding sending to random speaker, a vanilla way of doing that to different speakers can be done sending by having a [receive~ ] with a distinct name going into each [dac~] channel, then route the output of [readsf~] into a [send~] and then use the [set ..( message to set the destination to a "random" [receive~].

      Create a [receive~] object in Pd and right click on it, it will bring up the help file. Similar for [send~] or any other object whose behaviour you want to know more about. After reading those, let me know if you have further questions not answered there.

      Following this up — I'm not getting readfs~ to output anything on Bela. When I use my macbook locally, I can only get readfs~ to output one instance at a time. So something like this:

      alt text

      Only plays dac~ 3 (on my computer. bela plays nothing atm)