How would I be able to play a .wma
file in Python? Let's just say the file name is Scream.wma
Asked
Active
Viewed 2,018 times
-2

Name McChange
- 2,750
- 5
- 27
- 46

Ethan Bacon
- 233
- 1
- 2
- 7
-
See [this earlier answer](http://stackoverflow.com/questions/7674442/code-for-playing-video-in-wx-media-after-the-wmv-file-is-loaded) – Floris May 27 '13 at 22:51
-
`.wmv` stands for Windows Media _Video_. – kirelagin May 27 '13 at 22:51
-
Sorry meant the sound file – Ethan Bacon May 27 '13 at 22:52
-
Sorry to be picky... Cannot parse "meant the sound file". If the file name is `scream.wmv`, it is a video file. Is the name `scream.wav`? – Floris May 27 '13 at 22:53
-
Yes it is an audio file. Sorry again. : – Ethan Bacon May 27 '13 at 22:55
-
3A simple google search *"play sound in python"* was enough for this question. – Ashwini Chaudhary May 27 '13 at 22:55
-
google is your friend: https://www.youtube.com/watch?v=ftQ6A3DKKeg – aldeb May 27 '13 at 23:04
1 Answers
0
http://wiki.python.org/moin/Audio/ has a long list of audio libraries. There's even one on the list called wave, which is just for WAV files. Besides those you can use PyGame:
import pygame
import pygame.mixer
pygame.mixer.music.load('file.wav')
pygame.mixer.music.play()

kirbyfan64sos
- 10,377
- 6
- 54
- 75