Temporary file

Help for Audacity on Windows.
Forum rules
ImageThis forum is for Audacity on Windows.
Please state which version of Windows you are using,
and the exact three-section version number of Audacity from "Help menu > About Audacity".


Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Post Reply
DERF
Posts: 331
Joined: Sun Jun 13, 2010 12:37 pm
Operating System: Please select

Temporary file

Post by DERF » Mon Aug 17, 2015 12:18 pm

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:

Code: Select all

(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.

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Temporary file

Post by Gale Andrews » Mon Aug 17, 2015 2:42 pm

DERF wrote:does Windows 8 get deleted automatically the audio files placed in the file "Temp" at the end of a few days?
I don't believe so. You must have already configured an automatic cleanup in some software.
DERF wrote:The code Nyquist allows to look for an audio file only in the file: Users\...(name)...\AppData\Local\Temp\.
I don't know much about Nyquist but you can specify the full path if you use double backslash or forward slash

Code: Select all

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

Code: Select all

(play (s-read "C:/p.wav"))
Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

steve
Site Admin
Posts: 80677
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Temporary file

Post by steve » Mon Aug 17, 2015 3:52 pm

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.
DERF wrote:The code Nyquist allows to look for an audio file only in the file: Users\...(name)...\AppData\Local\Temp\.
As it says in the Nyquist manual (http://www.cs.cmu.edu/~rbd/doc/nyquist/):
http://www.cs.cmu.edu/~rbd/doc/nyquist/ ... l#index626
(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; http://www.cs.cmu.edu/~rbd/doc/nyquist/indx.html


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

Code: Select all

(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.)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Temporary file

Post by Gale Andrews » Mon Aug 17, 2015 4:13 pm

steve wrote:You can set *default-sf-dir* to any valid directory on your computer.
So we have it here, what is the syntax to do that?

Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

steve
Site Admin
Posts: 80677
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Temporary file

Post by steve » Mon Aug 17, 2015 4:26 pm

Gale Andrews wrote: So we have it here, what is the syntax to do that?
The same as setting any other symbol value:
(setf symbol value)

For example, on Linux it could be:

Code: Select all

(setf *default-sf-dir* "/home/user-name/Desktop/")
Then to read "my-file.wav" from the Desktop:

Code: Select all

(s-read "my-file.wav")
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply