Startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOWĪ = subprocess.call('C:\\Program Files (x86)\\Windows Media Player\\wmplayer.exe /play /close "C:/Users/Student/Documents/notes/file.mp3"',startupinfo=startupinfo) Why I had to do something so bizarre to get a simple result I have no idea, but it is the only thing that worked. This makes it seem like it plays without a secondary application. Technically I still open windows media player with this approach, but I do so using subprocess, and thus I can use the greater control over the process allowed by that to supress the window. However, just today I had an idea which has led to an alternative solution. None of them really worked, so I was stuck using os.startfile to open windows media player to play my sound files. I tried a ridiculous number of different approaches. As I have mentioned in comments, I have had an identical problem.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |