Quote:
Originally Posted by Selim Achour
Actually no, the file is kept.
Steps to reproduce :
1. Create a session
2. Record some audio
3. Delete the item
4. Save the session
Look and you'll see the audio file is still there on the hard drive.
|
Yes, the file is kept because the item/take and the PCM_source is just a way to refer to the file, it's not the file itself on disk.
So in principle, to be able to delete a media item along with its audio file, you should just do :
1) Get the PCM_source of the item's take and store the file name referred to
2) Delete/remove media item
3) Delete the audio file on disk using the operating system file delete function using the file name retrieved in step 1.
So this is like your original code, except PCM_Source_Destroy isn't called because it's not needed and is in fact going to cause a bug.