Problem when overwriting file with sfrecord~


    Oct 30 2015 | 6:29 pm
    Hi forum,
    I have what may be a simple problem.
    In the below patch, I am trying to record new audio by successively overwriting the same file with sfrecord~ & then playing it with sfplay~.
    I have found that after I overwrite the file the first time, sfplay~ no longer bangs when done. I understand that this has something to do with the duration of the file, but since I'm not aware of a "replace" command with sfrecord~ (as there is with buffer~), I don't know how to resize the file when I overwrite. Perhaps this isn't possible.
    I need the bang-when-done feature of sfplay~ for a timing functionality in my patch. That's why I'm not using a buffer~, etc.
    For info, I'm still on Max 6.
    Any ideas?
    Thanks in advance.- John

    • Oct 30 2015 | 8:21 pm
      UPDATE: I found a solution. By sending an "fclose" message to the sfplay~ object before reloading the overwritten file, the new audio (with new duration) will load & play completely to the end, triggering the bang-when-done function. I've never used "fclose" before; didn't know it existed.
      I hope this is helpful to someone else.
      John