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


Groups > comp.lang.python > #82697

RE: Simple background sound effect playback

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!bcyclone05.am1.xlned.com!bcyclone05.am1.xlned.com!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <jacob@blindza.co.za>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.007
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'tutorial': 0.03; 'wednesday,': 0.07; 'seemed': 0.09; 'snippet': 0.09; 'wrote': 0.14; '&gt;&gt;': 0.16; 'jacob': 0.16; 'pygame': 0.16; 'pygame,': 0.16; 'subject:effect': 0.16; 'wrote:': 0.18; 'module': 0.19; 'trying': 0.19; 'memory': 0.22; 'import': 0.22; 'email addr:gmail.com&gt;': 0.22; 'load': 0.23; 'compilation': 0.24; 'skip:n 60': 0.24; '&gt;': 0.26; 'skip:p 30': 0.29; 'errors': 0.30; 'url:mailman': 0.30; 'code': 0.31; '>>>>': 0.31; 'file': 0.32; 'url:python': 0.33; 'december': 0.35; 'something': 0.35; 'but': 0.35; 'subject:Simple': 0.36; 'url:listinfo': 0.36; 'thanks': 0.36; 'url:org': 0.36; 'being': 0.38; 'skip:& 10': 0.38; 'to:addr:python-list': 0.38; 'channel': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'space': 0.40; 'url:mail': 0.40; 'simple': 0.61; 'sound': 0.68; 'received:41': 0.70; 'song': 0.84
From "Jacob Kruger" <jacob@blindza.co.za>
To <python-list@python.org>
Subject RE: Simple background sound effect playback
Date Sat, 20 Dec 2014 16:02:51 +0200
MIME-Version 1.0
Content-Type multipart/alternative; boundary="----=_NextPart_000_006A_01D01C6E.687765E0"
X-Priority 3
X-MSMail-Priority Normal
X-Mailer Microsoft Windows Mail 6.0.6002.18197
X-MimeOLE Produced By Microsoft MimeOLE V6.1.7601.17609
X-Spam-Score -1.1 (-)
X-Spam-Report BAYES_00=-1.9, FSL_HELO_NON_FQDN_1=0.001, HTML_MESSAGE=0.001, RDNS_NONE=0.793, * 0.0 FSL_HELO_NON_FQDN_1 No description available. * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0001] * 0.0 HTML_MESSAGE BODY: HTML included in message * 0.8 RDNS_NONE Delivered to internal network by a host with no rDNS
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.17071.1419084197.18130.python-list@python.org> (permalink)
Lines 132
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1419084197 news.xs4all.nl 2897 [2001:888:2000:d::a6]:54997
X-Complaints-To abuse@xs4all.nl
X-Received-Bytes 7685
X-Received-Body-CRC 3511521479
Xref csiph.com comp.lang.python:82697

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Ok, thanks - the following seemed to work perfectly:

#start code
import pygame, time
pygame.mixer.init(frequency=22050, size=-16, channels=2, buffer=4096)
song = pygame.mixer.Sound("bird.ogg")
channel = pygame.mixer.Sound.play(song)
channel.set_volume(0, 1)
time.sleep(1)
channel.set_volume(1, 0)
channel = pygame.mixer.Sound.play(song)
time.sleep(1)
#end code

Will now just have to double-check/test compilation of something including something like this, using something like cx_freeze, etc., but, thanks again.

Stay well

Jacob Kruger
Blind Biker
Skype: BlindZA
...Roger Wilco wants to welcome you, to the space janitor's closet...
---original message---
<catalinfest@gmail.com> wrote in message news:e5f211da-d16a-4351-8094-55ba9d2d35a8@googlegroups.com...
> 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()
> -- 
> https://mail.python.org/mailman/listinfo/python-list
>

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


Thread

RE: Simple background sound effect playback "Jacob Kruger" <jacob@blindza.co.za> - 2014-12-20 16:02 +0200

csiph-web