Temporary file

Hello.
When we work in Audacity, and when we have not saved the project, the audio files are temporarily saved in:Users.… Name…\AppData\Local\Temp\Audacity_temp.
But, we can also place in the file “Temp” audio files that we can read in Audacity by using the following code Nyquist:

(play (s-read "... (name of the file)..."))

It can be interesting to have audio files which we are going to use as files of impulse, to use the filter convolve for example.
But there is a problem. I had placed the files of impulses in the file “Temp” to use them in several days. The problem is that one day, by opening the file, I observed that they had been deleted.

My question is the following one: does Windows 8 get deleted automatically the audio files placed in the file “Temp” at the end of a few days?
How is it necessary to proceed? The code Nyquist allows to look for an audio file only in the file: Users.…(name)…\AppData\Local\Temp.
Sorry for the translation.
Thank you for your help.

I don’t believe so. You must have already configured an automatic cleanup in some software.

I don’t know much about Nyquist but you can specify the full path if you use double backslash or forward slash

(play (s-read "C:\\p.wav"))



(play (s-read "C:/p.wav"))

Gale

I’m not a Windows user, but I know that some “computer maintenance” programs “clean” (empty) the temp folder periodically.
Certainly “temp” folders are not intended for long term storage.

As it says in the Nyquist manual (Nyquist Reference Manual):
Nyquist Functions

(s-read filename :time-offset offset :srate sr :dur dur :nchans chans :format format :mode mode :bits n :swap flag) [LISP]
Reads a sound from filename. The global default-sf-dir applies.

A good way to resolve these types of questions is to bookmark the index page of the Nyquist manual; Index


default-sf-dir is the default directory for sound files.
To view the current default you can run:

(print *default-sf-dir*)

You can set default-sf-dir to any valid directory on your computer.
You can also override the default by providing the full path and file name rather than just the file name. As Gale wrote, you need to be a bit careful about the “path separator”. The backslash character "" is used in Nyquist (and many other languages) as the “escape character”. So to write a Windows path name, you must either “escape” each backslash with a preceding backslash, or you can use a forward slash “/” instead (see Gale’s examples.)

So we have it here, what is the syntax to do that?

Gale

The same as setting any other symbol value:
(setf symbol value)

For example, on Linux it could be:

(setf *default-sf-dir* "/home/user-name/Desktop/")

Then to read “my-file.wav” from the Desktop:

(s-read "my-file.wav")