I want to play a .wav file in Python 3.4. Additonally, I want python to play the file rather than python open the file to play in VLC, media player etc..
As a follow up question, is there any way for me to combine the .wav file and the .py file into a standalone exe.
Ignore the second part of the question if it is stupid, I don't really know anything about compiling python.
Also, I know there have been other questions about .wav files, but I have not found one that works in python 3.4 in the way I described.
Using
pyaudio
you may get incorrect playback due to speed, consider instead:sudo apt-get install python-pygame
Windows:
choco install python-pygame
?I fixed the problem by using the module pyaudio, and the module wave to read the file. I will type example code to play a simple wave file.