[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] pygame.init before pygame.mixer.init?
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] pygame.init before pygame.mixer.init?
- From: "Brian Fisher" <brian@xxxxxxxxxxxxxxxxxxx>
- Date: Wed, 10 Oct 2007 15:54:06 -0700
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Wed, 10 Oct 2007 18:54:16 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=Py7gduaaexq7mTwzzXjVKGbV6BxrG+Lq2gElTgTY3Fo=; b=BbQs6tAp6rT4QMcZqZvVZ9bFXFUyU/GLRz50ALIfVb2EQkzN1dEahWRO6ENeDDfoM8YqRcQp/H9zBjTgl+8H4/ZCV32GZV0Gq/RlRxK8ZEFmk3FqmcMIbBOsTmWyL7SfP2h3Rm+VziHsvstPuX3soKy8JkgnQfEBZJ+PIGMIMHk=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=kfTz66bvm95Re5th0BzGNFgQpn44SaYd6IjX+HWdUzZZedQg3UVVdFVGH+2rSnwq6GnB2AtdtVFfz39TMbwa9tdu5C6gZrs5KrNKWNcHcPF4KnO4pkUBqZCaqoEdnuroTmQn5wJ2t7snrG+A0CLX2HiQgIHNgO3FJQpSaoAH+ZM=
- In-reply-to: <2768575AE4BD2740AFC4798322F0C1B0C2166D@xxxxxxxxxxxxxxxxxxxxx>
- References: <2768575AE4BD2740AFC4798322F0C1B0C2166D@xxxxxxxxxxxxxxxxxxxxx>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hi Clare,
comments below
On 10/10/07, Clare Richardson <clare@xxxxxxxxxxxxx> wrote:
> I writing a program to simply play one sound (see below for the code),
> and came across some interesting behavior. If I call pygame.init()
> before pygame.mixer.init(), I don't hear any sound playing. However if
> I call pygame.init *after* pygame.mixer.init (as below), the sound will
> play.
>
> Is this a known behavior? What's causing the problem? I understand
> that I don't need pygame.init to just play a sound, but I don't think it
> should matter if I call it.
>
The behavior you describe may very well be a bug, and is something
that should probably be fixed - and if some SDL and/or pygame source
programmer repro's it with your sample code, it probably will get
fixed.
However, I don't think calling pygame.mixer.init is ever really a good
thing, and you probably shouldn't bother. There is another function,
pygame.mixer.pre_init, which takes the same args as pygame.mixer.init,
and is specifically designed to be called before pygame.init
Basically if you are calling mixer.init without args... well I don't
think there is any benefit to doing so, and so you might be happier if
you don't
If you are calling it with args, well try calling
pygame.mixer.pre_init instead, just before your pygame.init call,
cause it will make sure your mixer gets init once only, the right way
for your given args you want to use.