[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] questions on pygame.mixer and pygame.mixer.music modules
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] questions on pygame.mixer and pygame.mixer.music modules
- From: Rene Dudfield <renesd@xxxxxxxxx>
- Date: Tue, 13 Sep 2005 10:11:39 +1000
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Mon, 12 Sep 2005 20:11:52 -0400
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=EESXIPtke+Wy1Ce3Y0ByeHIsX/n/f3zwD/wbq4Mdn+RR6EdMH3BhZ6DmRUAv2WT38MF3kbAZbIskoDpFfUarWoB8XJvpFUa0LiNg2wQEHx2Tv4g2nEYV/p/UhC2isIN8i8VNtCkn0gXmqa+FWjpN0TSKOEQ6VuwKIfrI+xngZyA=
- In-reply-to: <ed97310c050912165748d4a882@mail.gmail.com>
- References: <ed97310c050912165748d4a882@mail.gmail.com>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
On 9/13/05, Srinath Avadhanula <srinathava@xxxxxxxxx> wrote:
> Hello,
>
> I've been making a little "snooze alarm" clock on my linux machine
> using the pygame.mixer and pygame.mixer.music modules to produce the
> sound. I have a few questions:
>
> 1. Is it possible to "fade-in" a music piece? This would be nice to
> have to gently wake up the user (victim?). I already know that there
> is a set_volume which can be used do the same thing, but I would
> rather avoid writing loops because it blocks other events from
> registering.
>
There is a fadein, but it blocks. So I'm not sure if you'd want to use it.
Another option is to change the volume every time in your main loop as
you loop around. Check how much elapsed time has past, and adjust for
that.
> 2. I have two pieces which need to be played one after another. One
> piece is sampled at 22 KHz and the other at 44.1KHz. When I go from
> playing one piece to another, how do I set the sample rate? Do I need
> to .quit() the mixer and .init() it again?
>
> Thanks,
> Srinath
>
You should be able to set the mixer at 44, and it will mix both for
you without changing it. Try both and see :)