
I've uninstalled the latest Pure Data release (0.51-1) and installed an earlier stable release (0.5-2) and even tried an alternative called "purr data (latest release)" all with the exact same result on my windows 10 acer laptop: no file created, and program freezes after a few seconds. I suspect the two things are related- perhaps the program is attempting to write data somewhere, somehow, but it's going in the wrong place or some such and causing the program to freeze?

Here's the resulting function.Working with Pure Data, trying to record audio output from a patch I've made, and am 1) unable to create a file within pure data to write to and 2) attempting to use the writesf~ object causes the program to freeze after about two to three seconds. Or we can simply just play the audio by using the play function. We can use the audioUrl if we want to do any sort of custom behavior relating to playing audio that's more complicated than simply playing audio.

We can use the audioBlob if we need to store the data on the server. The stop function stops recording audio and returns a promise which resolves to an object that contains the audioBlob, the audioUrl, and a play function. The start function starts recording audio. We can accomplish this by converting our previous code into a function that returns a promise that resolves to an object that contains our API, which consists of 2 functions: start and stop. We can solve this problem by abstracting out the native API and instead use a much simpler API that we can create.


This is a pretty simple example of how to get audio to record, but we'll probably need to play audio for a lot of different web apps, so it would be kind of annoying to have to write all this code every time we want to record audio. If you run this in a browser, it will record audio from your microphone for 3 seconds, then play the audio that was just recorded.
