예제 #1
0
def array(sound):
    """pygame.sndarray.array(Sound): return array

    Copy Sound samples into an array.

    Creates a new array for the sound data and copies the samples. The
    array will always be in the format returned from
    pygame.mixer.get_init().
    """
    return numpysnd.array(sound)
예제 #2
0
def array (sound):
    """pygame.sndarray.array(Sound): return array

    Copy Sound samples into an array.

    Creates a new array for the sound data and copies the samples. The
    array will always be in the format returned from
    pygame.mixer.get_init().
    """
    if __arraytype == "numeric":
        return numericsnd.array (sound)
    elif __arraytype == "numpy":
        return numpysnd.array (sound)
    raise NotImplementedError("sound arrays are not supported")
예제 #3
0
def array (sound):
    """pygame.sndarray.array(Sound): return array

    Copy Sound samples into an array.

    Creates a new array for the sound data and copies the samples. The
    array will always be in the format returned from
    pygame.mixer.get_init().
    """
    if __arraytype == "numeric":
        return numericsnd.array (sound)
    elif __arraytype == "numpy":
        return numpysnd.array (sound)
    raise NotImplementedError("sound arrays are not supported")
예제 #4
0
def array(sound):
    """pygame.sndarray.array(Sound): return array

    Copy Sound samples into an array.

    Creates a new array for the sound data and copies the samples. The
    array will always be in the format returned from
    pygame.mixer.get_init().
    """
    global numpysnd
    try:
        return numpysnd.array(sound)
    except AttributeError:
        import pygame._numpysndarray as numpysnd
        return numpysnd.array(sound)