示例#1
0
def driver_init(device_name=None):
    global _device
    global _have_1_1

    # TODO devices must be enumerated on Windows, otherwise 1.0 context is
    # returned.

    _device = alc.alcOpenDevice(device_name)
    if not _device:
        raise Exception("No OpenAL device.")

    alcontext = alc.alcCreateContext(_device, None)
    alc.alcMakeContextCurrent(alcontext)

    if have_version(1, 1):
        # Good version info to cache
        _have_1_1 = True

    # See issue #163.
    import sys

    if sys.platform in ("win32", "cygwin"):
        from pyglet import clock

        clock.Clock._force_sleep = True
示例#2
0
 def __init__(self):
     #load device/context/listener
     self.device = alc.alcOpenDevice(None)
     self.context = alc.alcCreateContext(self.device, None)
     alc.alcMakeContextCurrent(self.context)
     alc.alcProcessContext(self.context)
     #get list of capture devices
     self.cap_devices = self.parse(
         alc.alcGetString(None, alc.ALC_CAPTURE_DEVICE_SPECIFIER))
     #capture device container
     self.captureDev = None
     #main buffer
     self.samplescaptured = ''
示例#3
0
文件: OpenAL_HRTF.py 项目: shaix/PyAL
    def __init__(self):
        #load device/context/listener
        self.device = alc.alcOpenDevice(None)
        self.context = alc.alcCreateContext(self.device, None)
        alc.alcMakeContextCurrent(self.context)

        #get list of available htrf tables
        self.hrtf_buffers = [alc.ALCint(), alc.ALCint * 4, alc.ALCint()]
        alc.alcGetIntegerv(self.device, alc.ALC_NUM_HRTF_SPECIFIERS_SOFT, 1,
                           self.hrtf_buffers[0])

        #attributes for device to set specified hrtf table
        self.hrtf_select = self.hrtf_buffers[1](alc.ALC_HRTF_SOFT,
                                                alc.ALC_TRUE,
                                                alc.ALC_HRTF_ID_SOFT, 1)
示例#4
0
def driver_init(device_name = None):
    global _device
    global _is_init
    global _have_1_1

    # TODO devices must be enumerated on Windows, otherwise 1.0 context is
    # returned.

    _device = alc.alcOpenDevice(device_name)
    if not _device:
        raise Exception('No OpenAL device.')

    alcontext = alc.alcCreateContext(_device, None)
    alc.alcMakeContextCurrent(alcontext)
    _is_init = True

    if have_version(1, 1):
        # Good version info to cache
        _have_1_1 = True
示例#5
0
def driver_init(device_name=None):
    global _device
    global _have_1_1

    # TODO devices must be enumerated on Windows, otherwise 1.0 context is
    # returned.

    _device = alc.alcOpenDevice(device_name)
    if not _device:
        raise Exception('No OpenAL device.')

    alcontext = alc.alcCreateContext(_device, None)
    alc.alcMakeContextCurrent(alcontext)

    if have_version(1, 1):
        # Good version info to cache
        _have_1_1 = True

    # See issue #163.
    import sys
    if sys.platform in ('win32', 'cygwin'):
        from pyglet import clock
        clock.Clock._force_sleep = True
示例#6
0
文件: OpenAL.py 项目: anden3/Python
 def __init__(self):
     self.device = alc.alcOpenDevice(None)
     self.context = alc.alcCreateContext(self.device, None)
     self._position = (0, 0, 0)
     self._orientation = (0, 0, 0)
     alc.alcMakeContextCurrent(self.context)
示例#7
0
 def __init__(self):
     # load device/context/listener
     self.device = alc.alcOpenDevice(None)
     self.context = alc.alcCreateContext(self.device, None)
     alc.alcMakeContextCurrent(self.context)
示例#8
0
 def __init__(self):
     #load device/context/listener
     self.device = alc.alcOpenDevice(None)
     self.context = alc.alcCreateContext(self.device, None)
     alc.alcMakeContextCurrent(self.context)
示例#9
0
文件: OpenAL.py 项目: anden3/Python
 def __init__(self):
     self.device = alc.alcOpenDevice(None)
     self.context = alc.alcCreateContext(self.device, None)
     self._position = (0, 0, 0)
     self._orientation = (0, 0, 0)
     alc.alcMakeContextCurrent(self.context)