Until recently I've been using python 3.63. When I need to use Pydub's audio_segment I do it like this to avoid a flash of the console when the app is frozen in a pyinstaller exe:
subprocess.STARTUPINFO.dwFlags |= subprocess.STARTF_USESHOWWINDOW
audio = AudioSegment.from_file('path_to_file')
Since moving to Python 3.10 this creates the error:
AttributeError: type object 'STARTUPINFO' has no attribute 'dwFlags'
I have tried adding options like:
creationflags=subprocess.CREATE_NO_WINDOW
and
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
startupinfo.wShowWindow = subprocess.SW_HIDE
p = subprocess.Popen(conversion_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, startupinfo=startupinfo)
to pydub itself, but the flash of console is always there. I've Googled for hours and got nowhere...