On Dec 10, 2007 10:26 PM, Alex Holkner <[EMAIL PROTECTED]> wrote: > > On 12/11/07, Nathan <[EMAIL PROTECTED]> wrote: > > > > In the docs for media.load(): > > > > " > > ... > > streaming : bool > > If False, a StaticSource will be returned; otherwise (default) a > > StreamingSource is created. > > > > Returns: Source" > > > > Shouldn't that second line say "Returns: StaticSource or > > StreamingSource"? Or is that implied since those are both subclasses > > of Source? > > That is implied -- or, at least, I'm implying it now ;-). There are > several other instances like this in the documentation; for example, > many methods are documented to return AbstractImage or Texture, when > they actually return one of several subclasses of these (ImageData, > CompressedTexture, TextureRegion, ...).
Ok, good to know. Half the battle is just learning the conventions
that are used.
Assuming that media.load(..., streaming=False) is the preferred
method, I suggest the following (which is also attached as a patch
file to this message):
Index: pyglet/media/__init__.py
===================================================================
--- pyglet/media/__init__.py (revision 1511)
+++ pyglet/media/__init__.py (working copy)
@@ -67,7 +67,7 @@
explosions. You can force such sounds to be decoded and retained in memory
rather than streamed from disk by wrapping the source in a `StaticSource`::
- bullet_sound = StaticSource(load('bullet.wav'))
+ bullet_sound = load('bullet.wav', streaming=False)
The other advantage of a `StaticSource` is that it can be queued on any number
of players, and so played many times simultaneously.
By the way, I tried out your LazySusan pyweek app. Nice work! How
did you get the vertices for your models? Did you use Blender or
something similar to that and just export them?
~ Nathan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---
minor_docstring.patch
Description: Binary data
