[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Compiling music into a game?



OK, I *finally* got around to trying this and am having problems on
Windows XP.   I open my sound file, write it to a temporary file created
with tempfile.NamedTemporaryFile() and that all seems to work.  
However, when I try to create a pygame.mixer.Sound with the temp file, I
get a NameError.   I printed the tempfile name and printed debug
statements after I wrote to it so I'm assuming it got created and
written to successfully.
 
Any ideas?

On Tue, 08 Feb 2005 10:06:28 -0600, "Joe Wreschnig"
<piman@xxxxxxxxxxxxxx> said:
> On Tue, 2005-02-08 at 09:35 -0500, shandy@xxxxxxxxx wrote:
> > I assume that the content providers are concerned with you distributing
> > them as .ogg files that can just be simply copied by the end user.
> > 
> > The easiest way to distribute them then would be all together in a zip
> > file and DON'T unzip them on the end user's machine, just use the python
> > zipfile module.
> 
> Pygame can't do that; mixer.music can only load from disk, not a
> file-like. You'd have to extract the file, play it, and remove it when
> you're done.
> -- 
> Joe Wreschnig <piman@xxxxxxxxxxxxxx>