gensound creates temp audio files which don't get clean up afterwards #28
-
Hello there, Really loving this project, every feature I have tried so far has been an absolute wonder! I have only 1 problem so far that I hope someone can help me fix.
When I run this code on PyCharm, it plays normally leaving nothing behind (or at least none that I can find anywhere). But if I export this code using pyinstaller into an .exe file and run that, a folder called gensound_temp is created where I have the .exe file, and a .wav temp file is generated every time play() is called. This folder and all its files are kept permanently, or until I manually delete them. Is it possible for these files to be cleaned up afterwards? If this is unwanted behavior, please let me know what info can I provide to help diagnose the problem. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
Welcome, and thanks for the feedback! My suggestions:
Steps 3&4 will let us know if the temporary file is created because of playback limitations, or due to reading MP3 files, which are not supported natively by Python. If step 3 does not create an extra file, a temporary solution would be to just use WAVs (gensound can help convert), although that's far from ideal of course. Another non-ideal solution is to call |
Beta Was this translation helpful? Give feedback.
-
And two more things:
wav = gs.WAV('D:\\System\\Desktop\\water_alarm.mp3')
audio = wav.realise() # create Audio object once
audio.play() # run this as many times as you want
time.sleep(2) This is because every time you run
|
Beta Was this translation helpful? Give feedback.
-
#28 (reply in thread) <- The answer followed by the explanation |
Beta Was this translation helpful? Give feedback.
#28 (reply in thread) <- The answer followed by the explanation