[Dev] A problem with sound assets and deserialization

James Paige Bob at HamsterRepublic.com
Fri May 2 13:47:14 PDT 2008


On Fri, May 02, 2008 at 01:28:01PM -0700, Brian Fisher wrote:
>    When you mentioned about making a dummy sound, it seemed like a bit of an
>    awkward way to handle things, but given that I have never in my life found
>    a computer without a sound card/output device (just a bunch without
>    speakers) I wasn't able to test or have an educated opinion on that front.

I thought it was awkward too, but it was all I could get to work at the 
time.

>    It seems to me that a soundasset should probably always be a soundasset,
>    but probably have a do-nothing behavior if it doesn't have any internals
>    (i.e. it couldn't make a pygame sound).

I agree.

>    The reason that seems better to me is because if we start adding new
>    functionality to soundasset, it would be likely to be out of sync with the
>    faked functionality of dummysoundasset or whatever (i.e. we wouldn't be
>    adding the same interface functions to both because it is so rare to use a
>    dummy sound). While if a soundasset just needs to deal with having no
>    internal buffer to play or something like that, then looking at soundasset
>    code it would generally be obvious you need to deal with it, so it would
>    be easier to remember and figure out (in my mind at least)

I should clarify that there is no fake soundasset, there is a fake 
pygame sound assigned to the soundasset's __rawsound member.

---
James




More information about the Dev mailing list