Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #82687

Re: Simple background sound effect playback

Newsgroups comp.lang.python
Date 2014-12-20 02:02 -0800
References <65314F0A9A824416A920374265BD359C@JakePC> <CALwzidmGOzhnHVxbYrk3DesEuqOddZGzLkcG5pR5Jg6SJ40SyA@mail.gmail.com> <mailman.17015.1418846538.18130.python-list@python.org>
Message-ID <e5f211da-d16a-4351-8094-55ba9d2d35a8@googlegroups.com> (permalink)
Subject Re: Simple background sound effect playback
From "catalinfest@gmail.com" <catalinfest@gmail.com>

Show all headers | View raw


See this :

>>> pygame.mixer.init(frequency=22050, size=-16, channels=2, buffer=4096)
>>> song = pygame.mixer.Sound("bird.ogg")
>>> pygame.mixer.Sound.play(song)
and then use the 
>>> channel.set_volume(0, 1)
>>> time.sleep(1)


On Wednesday, December 17, 2014 10:02:30 PM UTC+2, Jacob Kruger wrote:
> 
> 
> Ok, trying simple code from a pygame tutorial 
> snippet - nothing happens - just silent, but with no errors being 
> returned:
> # import the pygame module
> import  pygame
> # start pygame
> pygame.init()
> # load a sound file into memory
> sound = pygame.mixer.Sound("bird.ogg")
> channel = sound.play()

Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: Simple background sound effect playback "Jacob Kruger" <jacob@blindza.co.za> - 2014-12-17 21:41 +0200
  Re: Simple background sound effect playback "catalinfest@gmail.com" <catalinfest@gmail.com> - 2014-12-20 02:02 -0800

csiph-web