[Tutor] sound implementation problems

jessica peters howewriter2000 at yahoo.com
Mon Jun 17 12:00:44 CEST 2013


Resubmitting this because my list permissions got disabled (not totally sure why), so I've been off it since Friday.
 
my website: http://jahowe.com

----- Forwarded Message -----
From: jessica peters <howewriter2000 at yahoo.com>
To: Francois Dion <francois.dion at gmail.com> 
Sent: Friday, June 14, 2013 9:26 AM
Subject: Re: [Tutor] sound implementation problems
 


It comes from http://www.freestockmusic.com/.  I should note I was looking for .wav files, because I was having issues getting .mp3 files to read either, and I remembered that the "Hello World" stuff had worked with .wav files.

Not sure what you mean by what the comp says about the file itself while it's playing; it opens fine in Windows Media Player, no error messages or anything at all.
 
my website: http://jahowe.com


________________________________
 From: Francois Dion <francois.dion at gmail.com>
To: jessica peters <howewriter2000 at yahoo.com> 
Sent: Friday, June 14, 2013 9:15 AM
Subject: Re: [Tutor] sound implementation problems
 


In the header of a WAV file are a bunch of identifiers. One is the WAVE data format (32 bit, 16 bit signed, 12 bit u-law, 8 bit, ADPCM etc). For some reason, 0x4x correspond to a format that is not supported by pygame. That's unusual. Is the .wav file you are using somewhere on the net? I could check it out. If you open it in a sound editor, what does it say about the format?




On Fri, Jun 14, 2013 at 7:58 AM, jessica peters <howewriter2000 at yahoo.com> wrote:

That was a good point; I'd forgotten about having to have stuff all in same directory.  So I moved the files so they'd be there, and now have another error:
>
>
>>>Traceback (most recent call last):
>>>   File "Horsemen_soundtest.py", line 5, in (module)
>>>     snd = pygame.mixer.Sound("bach-cello-suite-1.wav")
>>>pygame.error: Unknown WAVE data format: 0x4x
>>>C:\Documents and settings\jessica howe\Desktop\GAME DESIGN\JA HOWE GAMES\WIP gam
>>>es\FOUR HORSEMEN)
>
>
>Ideas why it now says the format of the WAVE file's wrong?  I'm pretty sure it should be called .wav but don't know what the numbers are for.
>
>
> 
>my website: http://jahowe.com
>
>
>
>________________________________
> From: Francois Dion <francois.dion at gmail.com>
>To: jessica peters <howewriter2000 at yahoo.com> 
>Sent: Friday, June 14, 2013 7:31 AM
>
>Subject: Re: [Tutor] sound implementation problems
> 
>
>
>On Fri, Jun 14, 2013 at 6:58 AM, jessica peters <howewriter2000 at yahoo.com> wrote:
>
>Thanks for the info.  My comp will play sound normally, both from online and from the training chapter stuff I did when I was working with "Hello World", so I know it's supposed to work.
>>
>>
>>I tried the suggestion and got this error:
>>
>>
>>>>Traceback (most recent call last):
>>>>    File "Horsemen_soundtest.py", line 5, in (module)
>>>>       snd = pygame.mixer.Sound("bach-cello-suite-1.wav")
>>>>pygame.error: Mix_LoadWAV_RW with NULL src
>>>>C:\Documents and settings\jessica howe\Desktop\GAME DESIGN\Python\Python study ga
>>>>ames\study game files)
>>
>>
>>I'm getting a different error message at least!  But I'm not sure why this one.  It looks like the mixer is having difficulty loading.
>
>
>Now we are getting somewhere. Pygame is not finding the .wav file where 
it's looking. Specify an absolute path. Are the script and .wav files in
 the same directory?
>
> 
> Oh yeah, why do I need to put in the get_busy code twice the same way?
>
>
>
>
>As for the get_busy(), it serves the same purpose as the 
boolean value you had set up in your initial code you posted 
(musicPlaying = True). You only need to call it when you want to know if the sound is still playing (it'll return a 1) or it finished (it'll 
return a 0, and you can cue the next ambiance music).
>
>
>
>Francois
>--
>www.pyptug.org  -  raspberry-python.blogspot.com  -  @f_dion
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130617/e79fa1b3/attachment.html>


More information about the Tutor mailing list