[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Strange mixer problem
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] Strange mixer problem
- From: Julian Marchant <onpon4@xxxxxxxxx>
- Date: Wed, 7 Mar 2012 14:32:20 -0800 (PST)
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Wed, 07 Mar 2012 17:32:28 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1331159540; bh=ykQPGAfezdU1Y/UJlv0sCS1XkaBzWYnoz+pQRBrivoI=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=4YG5D3wayokXwkdSiLVjkmVzuetEOl1CEfDY9sCQ8nTP48MCFeibGnUuQ6vVcLqKDA2Ki0udh/9WO45rJCVPp4gBmF0ol3b/XdXy5Vyw25174/fI6r/1JTaK/+bzk6DRVXYRuZ8YPr4NsFtNlqq9SIrIFkrYJinoSqkuf4GdgwM=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=Y9BxaRDPD9rU9kJAlpnvUv/qHlK1IqmpGcsz+4euvGivqk2ad12pnGYVQYiMA0fY05SCpIVKdaPvD+gxtFpkRtk7SRCSJtWa0L2W6qZSVbn2Sz26MVhPWZlXOhOGX2usSVWoj54qQ0h13ac9RQjpCvZ19PFogKRA6MycMcPMHK0=;
- In-reply-to: <1256df00fe6394a3f244f29b75110712@localhost>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
I could be wrong, but it seems to me like the program is just exiting before the sound has a chance to play in full. Try adding a wait at the end (e.g. pygame.time.wait(2000)).
--- On Wed, 3/7/12, Danny Campbell <danny.campbell@xxxxxxxxx> wrote:
> From: Danny Campbell <danny.campbell@xxxxxxxxx>
> Subject: [pygame] Strange mixer problem
> To: pygame-users@xxxxxxxx
> Date: Wednesday, March 7, 2012, 9:56 PM
>
> I am running this on Ubuntu Natty, and I've had this problem
> on a separate
>
> occasion on a different Natty machine. Basically, in some
> circumstances, I
>
> can't play a sound with the following code:
>
>
>
> import pygame.mixer
>
>
>
> pygame.mixer.init()
>
> pygame.mixer.Sound("1up.wav").play()
>
>
>
> There will either be a click, or more often, no sound at
> all. There are no
>
> error messages. I have tried using pygame.mixer.get_init()
> to check if the
>
> mixer has been properly initialized (which it seems to have
> been). I've
>
> tried using pygame.mixer.pre_init() to specify certain
> settings (my sound
>
> files are 22050Hz and 1 channel). This didn't help, either.
>
>
>
> The strangest and most confusing thing is that it will run
> just fine in
>
> the Python interactive shell. If I load the Python shell and
> copy and paste
>
> this exact code into it, I get the expected sound.
>
>
>
> I can't for the life of me figure out what the difference
> would be between
>
> the command line and the interactive shell (I've double
> checked the version
>
> of the shell and the version I'm using from the command
> line, they are the
>
> same).
>
>
>
> I'm probably missing something very simple, but I've been
> pulling my hair
>
> out with this and am not sure how to proceed. :)
>
>
>
> Please let me know if I should send the sound file in
> question.
>