buffer~ write permissions error
I’m getting an error when writing buffer~ files using the "write" message. If I supply just a filename, I get a permissions error: "jsoundfile_writefloats: could not create output stream. check permissions of output directory." If I supply an absolute path, the file writes no problem.
write myBuff.aiff –> error
write "Macintosh HD:/Users/david/Desktop/bufferwritetest/myBuff.aiff" –> writes file
Same problem here , I can write to disk from buffer if I manually provide a location "C:/here.wav"
But if I try to write to disk with a message box (write here) or many other variations , it fails with the same error message above plus could not create file.
could there be a work around? Perhaps max can display where the standalone or main prog is located as a message. If so, by prepending that with "write" and appending it with here.wav it should be possible to save a file without the need for user input with a opendialog….and be able to find that file again without user input.
p.s max states "A standard file dialog is opened for naming the file unless the word write is followed by a symbol, in which case the file is saved in the current default folder, using the symbol as the filename" = this does not seem to work.
a solution that worked for me on windows xp 64
within a patch use an object called (standalone) in its inspector check make application subfolder search path.
use " write ./this.wav"
the wav is then stored in the patcher location.
and " read ./this.wav " to refill buffer.
Two questions: how do I find the "output directory" alluded to in this error? Seemed to be working fine before, now I’m seeing this error…
Second, how can I use write with a full filepath and a variable for the name of the file?
write "Macintosh HD:/Users/gina/directory/$1.aiff"
saves a file named $1.aiff. The message object strips quotation marks automatically, so I’m having trouble getting what I want here.
"append" doesn’t work either because it puts a space between arguments.
Thanks for your help!
If You know exactly the path use for example sprintf symout Macintosh HD:/Users/gina/directory/%s.aiff
Send file name to write to sprintf and insert prepend write between sprintf and buffer.
If there are any spaces in file name insert tosymbol in front of sprintf.
There are many ways of getting the app or patch path, and having specific folder
for that kind of action.
Or opendialog fold to select a folder, and pass that to sprintf as first part of the path.
if any of you are trying to write from a buffer over a preexisting file name ( rewrite the same file name)
you may, like me , need to delete the object play~ or whatever your using to actually play the file with, with scripting ,
before you try to re-write over it.
it was the only way i could get it to write consistently and avoid the error:
jsoundfile_writefloats: could not create output stream. check permissions of output directory.
so requires thispatcher to create, rejoin and reposition the objects with the cords of the section of the patch causing the trouble of writing.
takes a bit of time but does solve the failure to write if you have the file name already loaded up somewhere in the patch.
Forums > MaxMSP