How to record audio, but save file path after recording?
Hello all,
Right now I have a patch where I am sending an "open wave" message to an sfrecord~ object to specify a file location. After, I manually send a 1 and 0 to the sfrecord~ to start and stop recording and once the recording is stopped the file is there.
However I would like to be able to record first, then after the recording has ended, specify a file location.
Is there a way to do this with the buffer~ and opendialog objects?
Attached is the recording aspect of my patch. Note that the recorded files must be 16kHz sample rate but I assume that won't be a problem because after all, this is Max.
Any help is greatly appreciated.
Why not just use 'write' to [buffer~] when you want to save as a file?
With buffer I still have to specify a recording time before hand. I need to be able to press a button to record for as long as I want (or be able to specify a time) and after user stops the recording, they should be presented with a finder screen to choose a file path. The files should be 8 channel 16kHz wave files.
Indeed, you have to set a buffer~ duration in advance. For unknown duration, you would use sfrecord~.
If you really want to show the dialog after the recording, you would have to fake it the way other audio software do it:
- first, open a file in [sfrecord~] automatically, that will serve as temp file.
- start the recording.
- when the recording is done, present your dialog.
- copy the temp file to the user's new file location.
- ideally, delete the temp file without user dialog.
Another approach if you want to simply avoid a dialog before recording is to completely automate the file naming, for instance setting a "recordings" folder then opening an automatically numbered file. That would be quite easier to do in Max than what I described above.
Ahh thank you I see now. You need to specify something prior to recording, the user just doesn't have to know.