Problem deleting a file - HELP URGENT PLEASE!

Hey guys,

I just made a feature in my app, which i can record a sound using media.newRecording() and then i can rear it using media.playSound()

but if i don’t like the recording, i want to delete the file, and record it again. But, i just can do that, if i never use media.playSound() on the recorded file, after that, i can’t delete the file.

it’s like the file is in use by the system, and then i can’t erase it. How can i release the file after play it?

Thank you in advance.

Regards,
John
[import]uid: 124613 topic_id: 34085 reply_id: 334085[/import]

Just to make sure I understand the problem.

If you record the sound and do not play it, you can delete it.
If you record the sound and you do play it, you cannot delete it.

What happens if you use audio.loadSound() and audio.play() vs. media.playSound()? [import]uid: 199310 topic_id: 34085 reply_id: 135512[/import]

Yes, exactly:
If irecord the sound and do not play it, i can delete it.
If i record the sound and i do play it, i cannot delete it
Tryed now using audio.loadSound() and audio.play(), and i can delete and record the sound again (with the same file name), but then, when i try to load the sound again on the app, and sound reproduced is the first one , not the new one.
Probabily because corona use the caches for the calls for file with the same name right? But how can i fix it?

[import]uid: 124613 topic_id: 34085 reply_id: 135524[/import]

You probably need to call audio.dispose() to get rid of the in-memory version.
[import]uid: 199310 topic_id: 34085 reply_id: 135525[/import]

Already done that.
Doing that i can delete the audio and record it again. But then, when i try to play it, the audio played is the first one (the deleted), not the second (the recorded again).

As i said, probabily it`s the corona cache for resources, but, how can i release the cache too? [import]uid: 124613 topic_id: 34085 reply_id: 135527[/import]

try nilling it out after you displose
audio.dispose( handle )
handle = nil [import]uid: 7911 topic_id: 34085 reply_id: 135530[/import]

Worked!!!

audio.dispose( handle )
handle = nil
THANKS A LOT! =] [import]uid: 124613 topic_id: 34085 reply_id: 135540[/import]

Just to make sure I understand the problem.

If you record the sound and do not play it, you can delete it.
If you record the sound and you do play it, you cannot delete it.

What happens if you use audio.loadSound() and audio.play() vs. media.playSound()? [import]uid: 199310 topic_id: 34085 reply_id: 135512[/import]

Yes, exactly:
If irecord the sound and do not play it, i can delete it.
If i record the sound and i do play it, i cannot delete it
Tryed now using audio.loadSound() and audio.play(), and i can delete and record the sound again (with the same file name), but then, when i try to load the sound again on the app, and sound reproduced is the first one , not the new one.
Probabily because corona use the caches for the calls for file with the same name right? But how can i fix it?

[import]uid: 124613 topic_id: 34085 reply_id: 135524[/import]

You probably need to call audio.dispose() to get rid of the in-memory version.
[import]uid: 199310 topic_id: 34085 reply_id: 135525[/import]

Already done that.
Doing that i can delete the audio and record it again. But then, when i try to play it, the audio played is the first one (the deleted), not the second (the recorded again).

As i said, probabily it`s the corona cache for resources, but, how can i release the cache too? [import]uid: 124613 topic_id: 34085 reply_id: 135527[/import]

try nilling it out after you displose
audio.dispose( handle )
handle = nil [import]uid: 7911 topic_id: 34085 reply_id: 135530[/import]

Worked!!!

audio.dispose( handle )
handle = nil
THANKS A LOT! =] [import]uid: 124613 topic_id: 34085 reply_id: 135540[/import]