Ejemplo n.º 1
0
pybasswasapi.py - is ctypes python module for WASAPI (http://www.un4seen.com).

BASSWASAPI is basically a wrapper for WASAPI drivers
BASSWASAPI requires a soundcard with WASAPI drivers.
'''

import ctypes

try:
    import bass
    import pybass
except ImportError:
    from . import bass
    from . import pybass

basswasapi_module, func_type = bass.load(__file__)

HSTREAM = pybass.HSTREAM
BASS_FILEPROCS = pybass.BASS_FILEPROCS

# Additional error codes returned by BASS_ErrorGetCode
BASS_ERROR_WASAPI = 5000


# Device info structure
class BASS_WASAPI_DEVICEINFO(ctypes.Structure):
    _fields_ = [('name', ctypes.c_char_p), ('id', ctypes.c_char_p),
                ('type', ctypes.c_ulong), ('flags', ctypes.c_ulong),
                ('minperiod', ctypes.c_float), ('defperiod', ctypes.c_float),
                ('mixfreq', ctypes.c_ulong), ('mixchans', ctypes.c_ulong)]
Ejemplo n.º 2
0
__doc__ = '''
pybass_sfx.py - is ctypes python module for
BASS_SFX - An extension allowing the use of Sonique, Winamp,
Windows Media Player, and BassBox visual plugins with BASS.
'''

import ctypes

try:
    import bass
    import pybass
except ImportError:
    from . import bass
    from . import pybass

bass_vst_module, func_type = bass.load(__file__)

# ~ from ctypes.wintypes import HINSTANCE
# ~ from ctypes.wintypes import HWND
# ~ from ctypes.wintypes import LPCWSTR
# ~ from ctypes.wintypes import HDC

HSTREAM = pybass.HSTREAM
BASS_FILEPROCS = pybass.BASS_FILEPROCS
HSFX = ctypes.c_long

# visualization plugin types
BASS_SFX_SONIQUE = 0
BASS_SFX_WINAMP = 1
BASS_SFX_WMP = 2
BASS_SFX_BBP = 3
Ejemplo n.º 3
0
__doc__ = '''
pybass_aac.py - is ctypes python module for
BASS_AAC - extension to the BASS audio library that enables the playback
of Advanced Audio Coding and MPEG-4 streams (http://www.maresweb.de).
'''

import ctypes

try:
    import bass
    import pybass
except ImportError:
    from . import bass
    from . import pybass

bass_aac_module, func_type = bass.load(__file__)

QWORD = pybass.QWORD
HSTREAM = pybass.HSTREAM
DOWNLOADPROC = pybass.DOWNLOADPROC
BASS_FILEPROCS = pybass.BASS_FILEPROCS

# Additional BASS_SetConfig options
BASS_CONFIG_MP4_VIDEO = 0x10700  # play the audio from MP4 videos

# Additional tags available from BASS_StreamGetTags (for MP4 files)
BASS_TAG_MP4 = 7  # MP4/iTunes metadata

BASS_AAC_STEREO = 0x400000  # downmatrix to stereo

# BASS_CHANNELINFO type
Ejemplo n.º 4
0
BASSmix - extension to the BASS audio library, providing the ability
to mix together multiple BASS channels, with resampling and matrix mixing
features. It also provides the ability to go the other way and split a
BASS channel into multiple channels.
'''

import ctypes

try:
    import bass
    import pybass
except ImportError:
    from . import bass
    from . import pybass

bassmix_module, func_type = bass.load(__file__)

QWORD = pybass.QWORD
HSYNC = pybass.HSYNC
HSTREAM = pybass.HSTREAM
DOWNLOADPROC = pybass.DOWNLOADPROC
SYNCPROC = pybass.SYNCPROC
BASS_FILEPROCS = pybass.BASS_FILEPROCS

# additional BASS_SetConfig option
BASS_CONFIG_MIXER_FILTER = 0x10600
BASS_CONFIG_MIXER_BUFFER = 0x10601
BASS_CONFIG_SPLIT_BUFFER = 0x10610

# BASS_Mixer_StreamCreate flags
BASS_MIXER_END = 0x10000  # end the stream when there are no sources
Ejemplo n.º 5
0
that enables the playback of OptimFROG streams.
'''


import ctypes


try:
    import bass
    import pybass
except ImportError:
    from .import bass
    from .import pybass


bass_ofr_module, func_type = bass.load(__file__)


QWORD = pybass.QWORD
HSTREAM = pybass.HSTREAM
BASS_FILEPROCS = pybass.BASS_FILEPROCS


# Additional tags available from BASS_StreamGetTags
BASS_TAG_APE = 6  # APE tags


# BASS_CHANNELINFO type
BASS_CTYPE_STREAM_OFR = 0x10600

Ejemplo n.º 6
0
BASS 2.4 is required. The Windows Media Format modules (v9 or above) are
also required to be installed on the user's system. They are installed with
Windows Media player, so will already be on most users' systems, but they
can also be installed separately (WMFDIST.EXE is available from the BASS website).
'''

import ctypes

try:
    import bass
    import pybass
except ImportError:
    from . import bass
    from . import pybass

basswma_module, func_type = bass.load(__file__)

QWORD = pybass.QWORD
HSTREAM = pybass.HSTREAM
BASS_FILEPROCS = pybass.BASS_FILEPROCS
HWMENCODE = ctypes.c_ulong  # WMA encoding handle

# Additional error codes returned by BASS_ErrorGetCode
BASS_ERROR_WMA_LICENSE = 1000  # the file is protected
BASS_ERROR_WMA = 1001  # Windows Media (9 or above) is not installed
BASS_ERROR_WMA_WM9 = BASS_ERROR_WMA
BASS_ERROR_WMA_DENIED = 1002  # access denied (user/pass is invalid)
BASS_ERROR_WMA_INDIVIDUAL = 1004  # individualization is needed
BASS_ERROR_WMA_PUBINIT = 1005  # publishing point initialization problem

# Additional BASS_SetConfig options
Ejemplo n.º 7
0
  MP3 ID3v1 and ID3v2.2/3/4
  OGG/FLAC comments
  WMA
  APE, OFR, MPC, AAC - all use APE tags
  MP4
  MOD/etc titles
'''

import ctypes

try:
    import bass
except ImportError:
    from . import bass

tags_module, func_type = bass.load(__file__)

# Current version. Just increments each release.
TAGS_VERSION = 15

# returns description of the last error.
# const char*  _stdcall TAGS_GetLastErrorDesc();
TAGS_GetLastErrorDesc = func_type(ctypes.c_char_p)(
    ('TAGS_GetLastErrorDesc', tags_module))

# main purpose of this library
# const char*  _stdcall TAGS_Read( DWORD dwHandle, const char* fmt );
TAGS_Read = func_type(ctypes.c_char_p, ctypes.c_ulong,
                      ctypes.c_char_p)(('TAGS_Read', tags_module))

# retrieves the current version