コード例 #1
0
ファイル: __init__.py プロジェクト: rkern/sympy-rkern
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
ファイル: Openal_Recording.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)
     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
ファイル: __init__.py プロジェクト: certik/sympy-oldcore
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
ファイル: __init__.py プロジェクト: jcockayne/sympy-rkern
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
ファイル: sound.py プロジェクト: vktrbhm/HRTF_Micro
 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)