0

When I try to run the following code, I don't recieve either any errors or any sound. The sound file is not broken, I've tried many other sounds files as well.

import pygame
pygame.mixer.init(44100, -16, 2, 2048)
sound = pygame.mixer.Sound("9001.wav")
sound.play()

The output is simply:

<Channel object at 0x00000000021EF258>
Michael Currie
  • 13,721
  • 9
  • 42
  • 58
Simon Larsen
  • 185
  • 1
  • 4
  • 12
  • are you sure this is pygame related? speakers turned on? volume up? did you try other sound files? – sloth Aug 22 '12 at 18:25
  • The sound file works when I listen to them in Windows Media Player and VLC. I have tried several sound files. – Simon Larsen Aug 22 '12 at 19:15
  • Wild guess: 1) Try running the python interpreter as administrator 2) Try initializing `pygame.mixer` with another frequenzy (like `22050`) – sloth Aug 22 '12 at 20:00
  • Some version information would help - what version of Windows, what version of Python? Also it looks like you're using 64-bit Python. Have you considered giving 32-bit a try? 32-bit compatibility might be better, depending on what your drivers and such. – cecilkorik Aug 23 '12 at 01:47
  • Okay so... Here's the thing that bugs me the most: When I try to use an old .py file where I play sounds, it works just fine. -Python 2.6.6 64bit, windows 7 64bit. #BigYellowCactus, changing the frequenzy did not help, and running as administrator did not help either :( – Simon Larsen Aug 23 '12 at 17:14
  • I just tried installing python and pygame with a 32 bit installation, it did not make any difference – Simon Larsen Aug 23 '12 at 20:46

1 Answers1

0

Okay so... After editing my file over and over again I finally got it working. Once I got it working I could just change my code back to what is was before. I have absolutely NO idea how to was fixed.

Simon Larsen
  • 185
  • 1
  • 4
  • 12