Thanks all for your replies, and especially thank you David.
I have tried the suggestions - I hadn't realised that the order of creating [delread~] and [delwrite~] could break my patch!
I have tried adding a [stop( message and deleting & replacing the [delread~ buffer 10000] object but it still doesnt output the audio using the [open rec.wav( message, with the toggle toggled on.
I'll upload the patch with this reply, if you find a way where it works please let me know:)
Apologies before I get started; quite new to PD and very new to this forum.
If this is the wrong way to submit a forum post, or if this is the wrong area of the forum, please let me know.
TLDR: I want a PD sketch which constantly records audio from mic to a circular buffer, meaning only the last 10 seconds is recorded to a buffer. I want to be able to save the 10sec of recorded audio, and then be able to play that audio.
This will be a PD file on a headless Raspberry Pi, and I am going to use Adafruit Retrogame to remap GPIO button presses into keyboard presses PD can use.
At one point I had this working, then I changed something and since then it's not done as it should. This is the file I'm working with,