Why are sometimes my sound files locked?

cabfe

Cool Cat
Veteran
Joined
Jun 13, 2013
Messages
2,353
Reaction score
2,549
First Language
French
Primarily Uses
RMVXA
Hello,

I was wondering why sometimes the editor is locking my sound files.
I have a sound file (0.5 second, 8KB) that, when played in the editor, is not locked when I try to delete it in the Windows Explorer.
If I copy/paste this file in Audacity to expand its length, then play it in the editor, I can no longer delete this file in the explorer unless I close the editor.

I've even tried with a sound file composed only of generated silence. Above the 2.756 seconds mark (more or less a few milliseconds) then the file becomes locked.

Questions time:
Why is the editor locking the files?
How can I prevent it?

It doesn't seem to be related to the file itself, since the same file saved with Audacity works under the 2.756 seconds mark.
 

Seriel

Veteran
Veteran
Joined
Aug 16, 2014
Messages
3,013
Reaction score
504
First Language
English
Primarily Uses
Other
I usually let another file play for a few seconds and it releases the original one.
 

cabfe

Cool Cat
Veteran
Joined
Jun 13, 2013
Messages
2,353
Reaction score
2,549
First Language
French
Primarily Uses
RMVXA
I've tried waiting, to no avail. Now I have two sound files locked. I'm wondering if it's a bug or a feature... :distrust:
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
When that happens to me, I have to wait until I close the editor, then go in to the audio folder and delete it manually.
 

cabfe

Cool Cat
Veteran
Joined
Jun 13, 2013
Messages
2,353
Reaction score
2,549
First Language
French
Primarily Uses
RMVXA
That's annoying, because I'm working on an alternate sound engine for encryption, but I'm stuck because of these locked sound files.

I can't figure why it happens, which makes it difficult to fix.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
Basically, if windows can't delete a file, that is because it's in use. However, that is not something directly checked - the file is marked as such on opening and remains that way until closing.


Having two programs open similiar-named files can get to problems here, but it can very well be that it's another program accessing those files as well - you have to close programs and check the results until you know which one causes the problem.
 

cabfe

Cool Cat
Veteran
Joined
Jun 13, 2013
Messages
2,353
Reaction score
2,549
First Language
French
Primarily Uses
RMVXA
It is related to the editor, no doubt here.

I used a program to get the handle of the locked file and which program is using it, and the only answer is the editor.

It allows deletion if the sound file is short (under 2.756 seconds in my testing) and locks the file above it.

I tried waiting for the sound to be played entirely, I also used the "stop" button. Nothing works. Once the editor locks the file, only quitting the editor can free the file again.

Or kill the handle with an external program, which seems overkill for my use.

Edit:

I couldn't prevent this lock, but I found an alternate way to access my sound files. Actually, I still have to test to be sure but it's even more effective than my previous attempt.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I've moved this thread to Tech Support - All Makers. Please be sure to post your threads in the correct forum next time. Thank you.
 

cabfe

Cool Cat
Veteran
Joined
Jun 13, 2013
Messages
2,353
Reaction score
2,549
First Language
French
Primarily Uses
RMVXA
Back to square one, I can't make the system read a specific file name inside an encrypted archive. I can extract the data, but not the path of the file...

And since the se_play function only takes a path and not the sound data, it doesn't work.

I still have to extract the data to a temporary file, but it gets locked after it's played (for sounds longer that 2.756s)

I've tried many ways to read and write data, but this darn undocumented audio function is broken and I can't fix it.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
What command are you using?
 

cabfe

Cool Cat
Veteran
Joined
Jun 13, 2013
Messages
2,353
Reaction score
2,549
First Language
French
Primarily Uses
RMVXA
I play my sound with:

Audio.se_play('<path+filename>', @volume, @pitch)

Which seems to lock the file after play, just like the editor does. It's probably the same command so I asked about the editor command first instead of scaring people with ruby code :|

If I could find a way to send the path of the file inside the rgss3a archive that could work, but load_data retrieves only the data, not the path to it. And this se_play command only wants a path, not the data itself...

At the moment I see two solutions:

-remove/prevent the lock of played sound files so I can use a temp file.

-retrieve the path to a specific file inside a rgss3a archive to send directly to se_play.

But I can't do it, at least not with my limited ruby skill.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,050
Members
137,571
Latest member
grr
Top