本文整理汇总了Python中pybass.get_error_description函数的典型用法代码示例。如果您正苦于以下问题:Python get_error_description函数的具体用法?Python get_error_description怎么用?Python get_error_description使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_error_description函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: playerCreate
def playerCreate(self, physicalChannelNumber):
# Creates a player handle for the supplied output number
if not pybass.BASS_Init(physicalChannelNumber, 44100, 0, 0, 0):
if pybass.BASS_ErrorGetCode() != pybass.BASS_ERROR_ALREADY:
raise ValueError('BASS_Init Error: %s' % pybass.get_error_description(pybass.BASS_ErrorGetCode()))
return False
if pybass.BASS_SetDevice(physicalChannelNumber) is False:
raise ValueError('BASS_SetDevice Error: %s' % pybass.get_error_description(pybass.BASS_ErrorGetCode()))
return False
# We use the channel mixer to allow playback of multiple items on the one output
channelMixer = pybassmix.BASS_Mixer_StreamCreate(44100, 2, pybassmix.BASS_MIXER_NONSTOP)
if channelMixer is False:
raise ValueError('BASS_Mixer_StreamCreate Error: %s - %s' % (repr(channelMixer), pybass.get_error_description(pybass.BASS_ErrorGetCode())))
else:
if pybass.BASS_ChannelPlay(channelMixer, False) is False:
raise ValueError('BASS_ChannelPlay (Mixer) Error: %s' % pybass.get_error_description(pybass.BASS_ErrorGetCode()))
if pybass.BASS_ChannelSetAttribute(channelMixer, pybass.BASS_ATTRIB_VOL, 1) is False:
raise ValueError('ERROR BASS_SetAttribute Error: %s' % pybass.get_error_description(pybass.BASS_ErrorGetCode()))
return channelMixer
开发者ID:MediaRealm,项目名称:tempo,代码行数:27,代码来源:AudioPlayback.py
示例2: __del__
def __del__(self):
self.method_free_handle()
if self.sound_font != 0 and pybassmidi:
if pybassmidi.BASS_MIDI_FontFree(self.sound_font):
print 'BASS_MIDI_FontFree error', pybass.get_error_description(pybass.BASS_ErrorGetCode())
for plugin in self.plugins.itervalues():
if plugin[0] > 0:
if pybass.BASS_PluginFree(plugin[0]):
print 'BASS_PluginFree error', pybass.get_error_description(pybass.BASS_ErrorGetCode())
开发者ID:syfenx,项目名称:pyBeats,代码行数:9,代码来源:wx_bass_control.py
示例3: method_free_handle
def method_free_handle(self):
if self.bass_handle:
channel_info = self.method_get_channel_info()
if channel_info.ctype >= pybass.BASS_CTYPE_MUSIC_MOD:
if not pybass.BASS_MusicFree(self.bass_handle):
print 'BASS_MusicFree error', pybass.get_error_description(pybass.BASS_ErrorGetCode())
else:
self.bass_handle = 0
elif channel_info.ctype >= pybass.BASS_CTYPE_STREAM:
if not pybass.BASS_StreamFree(self.bass_handle):
print 'BASS_StreamFree error', pybass.get_error_description(pybass.BASS_ErrorGetCode())
else:
self.bass_handle = 0
开发者ID:syfenx,项目名称:pyBeats,代码行数:13,代码来源:wx_bass_control.py
示例4: method_play
def method_play(self):
if self.bass_handle:
if self.method_get_state() in (pybass.BASS_ACTIVE_STOPPED, pybass.BASS_ACTIVE_PAUSED):
if not pybass.BASS_ChannelPlay(self.bass_handle, False):
print 'BASS_ChannelPlay error', pybass.get_error_description(pybass.BASS_ErrorGetCode())
else:
self.slider.timer_start()
self.btn_play.SetLabel(_('Pause'))
self.btn_stop.Enable(True)
else:
if not pybass.BASS_ChannelPause(self.bass_handle):
print 'BASS_ChannelPause error', pybass.get_error_description(pybass.BASS_ErrorGetCode())
else:
self.slider.timer_stop()
self.btn_play.SetLabel(_('Unpause'))
开发者ID:syfenx,项目名称:pyBeats,代码行数:15,代码来源:wx_bass_control.py
示例5: method_stop_audio_stream
def method_stop_audio_stream(self):
self.slider.timer_stop()
if self.bass_handle:
if not pybass.BASS_ChannelStop(self.bass_handle):
print 'BASS_ChannelStop error', pybass.get_error_description(pybass.BASS_ErrorGetCode())
else:
self.method_set_position(0)
开发者ID:syfenx,项目名称:pyBeats,代码行数:7,代码来源:wx_bass_control.py
示例6: method_load_data
def method_load_data(self, stream, name_stream = 'memory_stream'):
if stream is not None:
if isinstance(stream, (str, list, tuple, buffer)):
self.stream = memory_stream(stream, name_stream)
else:
self.stream = stream
if isinstance(self.stream, memory_stream):
system = pybass.STREAMFILE_BUFFER
flags = 0
def callback_close(user):
self.stream.current_position = 0
self.callback_close = callback_close
def callback_length(user):
return len(self.stream.data)
self.callback_length = callback_length
def callback_read(buffer, length, user):
b = pybass.ctypes.cast(buffer, pybass.ctypes.c_char_p)
pybass.ctypes.memset(b, 0, length)
data = pybass.ctypes.c_char_p(self.stream.read(length))
pybass.ctypes.memmove(b, data, length)
return length
self.callback_read = callback_read
def callback_seek(offset, user):
self.stream.seek(offset)
return True
self.callback_seek = callback_seek
self.bass_file_procs = pybass.BASS_FILEPROCS()
self.bass_file_procs.close = pybass.FILECLOSEPROC(self.callback_close)
self.bass_file_procs.length = pybass.FILELENPROC(self.callback_length)
self.bass_file_procs.read = pybass.FILEREADPROC(self.callback_read)
self.bass_file_procs.seek = pybass.FILESEEKPROC(self.callback_seek)
new_bass_handle = pybass.BASS_StreamCreateFileUser(system, flags, self.bass_file_procs, id(self.stream.data))
if new_bass_handle == 0:
print 'BASS_StreamCreateFileUser error', pybass.get_error_description(pybass.BASS_ErrorGetCode())
else:
self.method_stop_audio()
self.bass_handle = new_bass_handle
channel_info = self.method_get_channel_info()
if channel_info.ctype == pybass.BASS_CTYPE_STREAM_OGG:
import pyogginfo
ogg_info = pyogginfo.VorbisStreamInfo()
stream = pyogginfo.SimpleDemultiplexer(ogg_info)
if isinstance(self.stream.data, str):
stream.process(self.stream.data)
else:
stream.process(str(self.stream.data))
self.stream.decode_length = ogg_info.lastPosition
self.stream.seconds = ogg_info.stop
try:
for key, value in ogg_info.comments.comments:
if key == 'TITLE':
if value.strip() > '':
self.stream.name = value
except:
pass
self.method_slider_set_range()
self.method_check_controls()
开发者ID:syfenx,项目名称:pyBeats,代码行数:57,代码来源:wx_bass_control.py
示例7: getWaveformData
def getWaveformData(self, fileName):
# Gets sample data to be used as a waveform
# This is very high-res data. Pass the data to self.getSimplifiedWaveform() for a lower-res version
# Prepare BASS
if not pybass.BASS_Init(0, 44100, 0, 0, 0):
if pybass.BASS_ErrorGetCode() != pybass.BASS_ERROR_ALREADY:
raise ValueError('BASS_Init Error: %s' % pybass.get_error_description(pybass.BASS_ErrorGetCode()))
# Give the file a decoder handle
fileDecoderHandle = pybass.BASS_StreamCreateFile(False, fileName, 0, 0, pybass.BASS_STREAM_DECODE | pybass.BASS_SAMPLE_FLOAT | pybass.BASS_SAMPLE_MONO)
if fileDecoderHandle is False:
raise ValueError('ERROR BASS_StreamCreateFile Error: %s' % pybass.get_error_description(pybass.BASS_ErrorGetCode()))
time = 0
levelSamplesDB = {}
while pybass.BASS_ChannelIsActive(fileDecoderHandle):
# Loop until the end of the file
# Capture a 20ms sample of the levels
byte_pos = pybass.BASS_ChannelSeconds2Bytes(fileDecoderHandle, time)
pybass.BASS_ChannelSetPosition(fileDecoderHandle, byte_pos, pybass.BASS_POS_BYTE)
# This function is fixed to 20ms intervals
level = pybass.BASS_ChannelGetLevel(fileDecoderHandle)
# Left channel is stored in lower 16 bits. Since we're using a mono decoder, this should give us the average
lower16bits = level & 0x0000ffff
#upper16bits = level & 0x00000000FFFFFFFF
if lower16bits > 0:
levelSamplesDB[time] = 20 * math.log10(lower16bits / float(32768))
else:
levelSamplesDB[time] = -60
time += 0.001
return levelSamplesDB
开发者ID:jamesedenalyrius,项目名称:tempo,代码行数:40,代码来源:AudioImport.py
示例8: getDuration
def getDuration(self, fileName):
# Returns the file's duration in seconds
# Prepare BASS
if not pybass.BASS_Init(0, 44100, 0, 0, 0):
if pybass.BASS_ErrorGetCode() != pybass.BASS_ERROR_ALREADY:
raise ValueError('BASS_Init Error: %s' % pybass.get_error_description(pybass.BASS_ErrorGetCode()))
# Give the file a decoder handle
fileDecoderHandle = pybass.BASS_StreamCreateFile(False, fileName, 0, 0, pybass.BASS_STREAM_DECODE)
duration = pybass.BASS_ChannelBytes2Seconds(fileDecoderHandle, pybass.BASS_ChannelGetLength(fileDecoderHandle, pybass.BASS_POS_BYTE))
return duration
开发者ID:jamesedenalyrius,项目名称:tempo,代码行数:14,代码来源:AudioImport.py
示例9: playFile
def playFile(self, playerHandle, fileName, timeStretch = 1, startPositionSeconds = 0):
# Plays a file on the supplied playerHandle
# Also allows for time stretching
# Give the file a decoder handle
filePlayerHandle = pybass.BASS_StreamCreateFile(False, fileName, 0, 0, pybass.BASS_STREAM_DECODE)
if filePlayerHandle is False:
raise ValueError('ERROR BASS_StreamCreateFile Error: %s' % pybass.get_error_description(pybass.BASS_ErrorGetCode()))
# Add the file decoder channel to a FX Tempo (Speed) channel
tempoChannel = pybassfx.BASS_FX_TempoCreate(filePlayerHandle, pybassfx.BASS_FX_FREESOURCE)
if tempoChannel is False:
raise ValueError('ERROR BASS_FX_TempoCreate Error: %s' % pybass.get_error_description(pybass.BASS_ErrorGetCode()))
# Add the tempo (speed) channel to the output mixer
if pybassmix.BASS_Mixer_StreamAddChannel(tempoChannel, filePlayerHandle, pybassmix.BASS_MIXER_NORAMPIN) is False:
raise ValueError('ERROR BASS_Mixer_StreamAddChannel Error: %s' % pybass.get_error_description(pybass.BASS_ErrorGetCode()))
# Set time stretching on the tempo (speed) channel
if pybass.BASS_ChannelSetAttribute(tempoChannel, pybassfx.BASS_ATTRIB_TEMPO, timeStretch) is False:
raise ValueError('ERROR BASS_ChannelSetAttribute (Time Stretch) Error: %s' % pybass.get_error_description(pybass.BASS_ErrorGetCode()))
# Set the volume to 100%
pybass.BASS_ChannelSetAttribute(tempoChannel, pybass.BASS_ATTRIB_VOL, 1)
# Set the starting position in the file
start_position_bytes = pybass.BASS_ChannelSeconds2Bytes(filePlayerHandle, startPositionSeconds)
pybass.BASS_ChannelSetPosition(filePlayerHandle, start_position_bytes, pybass.BASS_POS_BYTE)
# Play the file
if pybass.BASS_ChannelPlay(tempoChannel, False) is False:
raise ValueError('ERROR BASS_ChannelPlay Error: %s' % pybass.get_error_description(pybass.BASS_ErrorGetCode()))
#Return the handle ID
return tempoChannel
开发者ID:MediaRealm,项目名称:tempo,代码行数:37,代码来源:AudioPlayback.py
示例10: method_load_wav_file
def method_load_wav_file(self):
import os
wildcard = 'wav (*.wav)|*.wav|All files (*.*)|*.*'
dlg = wx.FileDialog(self, message = _('Choose a file'), defaultDir = os.getcwd(), defaultFile = '', wildcard = wildcard, style = wx.OPEN|wx.CHANGE_DIR)
if dlg.ShowModal() == wx.ID_OK:
self.name_stream = file_name = dlg.GetPath()
if os.path.isfile(file_name):
flags = 0
if isinstance(file_name, unicode):
flags |= pybass.BASS_UNICODE
try:
pybass.BASS_CHANNELINFO._fields_.remove(('filename', pybass.ctypes.c_char_p))
except:
pass
else:
pybass.BASS_CHANNELINFO._fields_.append(('filename', pybass.ctypes.c_wchar_p))
def stream_callback(handle, buffer, length, user):
b = pybass.ctypes.cast(buffer, pybass.ctypes.c_char_p)
pybass.ctypes.memset(b, 0, length)
data = pybass.ctypes.c_char_p(self.stream.read(length))
pybass.ctypes.memmove(b, data, length)
if self.stream.is_eof():
length |= pybass.BASS_STREAMPROC_END
self.stream.current_position = 0
return length
self.stream_callback = stream_callback
self.user_func = pybass.STREAMPROC(self.stream_callback)
self.stream = memory_stream(open(file_name, 'rb').read(), file_name)
new_bass_handle = pybass.BASS_StreamCreate(44100, 2, flags, self.user_func, 0)
if new_bass_handle == 0:
print 'BASS_StreamCreate error', pybass.get_error_description(pybass.BASS_ErrorGetCode())
else:
self.method_stop_audio()
self.bass_handle = new_bass_handle
self.stream = None
self.method_slider_set_range()
self.method_check_controls()
开发者ID:syfenx,项目名称:pyBeats,代码行数:37,代码来源:wx_bass_control.py
示例11: method_load_file
def method_load_file(self):
import os
wildcard = 'music sounds (MO3, IT, XM, S3M, MTM, MOD, UMX)|*.mo3;*.it;*.xm;*.s3m;*.mtm;*.mod;*.umx'
wildcard += '|stream sounds (MP3, MP2, MP1, OGG, WAV, AIFF)|*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aiff'
for plugin in self.plugins.itervalues():
if plugin[0] > 0:
wildcard += plugin[1]
wildcard += '|All files (*.*)|*.*'
dlg = wx.FileDialog(self, message = _('Choose a file'), defaultDir = os.getcwd(), defaultFile = '', wildcard = wildcard, style = wx.OPEN|wx.CHANGE_DIR)
if dlg.ShowModal() == wx.ID_OK:
self.name_stream = file_name = dlg.GetPath()
if os.path.isfile(file_name):
flags = 0
if isinstance(file_name, unicode):
flags |= pybass.BASS_UNICODE
try:
pybass.BASS_CHANNELINFO._fields_.remove(('filename', pybass.ctypes.c_char_p))
except:
pass
else:
pybass.BASS_CHANNELINFO._fields_.append(('filename', pybass.ctypes.c_wchar_p))
error_msg = 'BASS_StreamCreateFile error'
new_bass_handle = 0
if dlg.GetFilterIndex() == 0:#BASS_CTYPE_MUSIC_MOD
flags |= pybass.BASS_MUSIC_PRESCAN
new_bass_handle = pybass.BASS_MusicLoad(False, file_name, 0, 0, flags, 0)
error_msg = 'BASS_MusicLoad error'
else:#other sound types
new_bass_handle = pybass.BASS_StreamCreateFile(False, file_name, 0, 0, flags)
if new_bass_handle == 0:
print error_msg, pybass.get_error_description(pybass.BASS_ErrorGetCode())
else:
self.method_stop_audio()
self.bass_handle = new_bass_handle
self.stream = None
self.method_slider_set_range()
self.method_check_controls()
开发者ID:syfenx,项目名称:pyBeats,代码行数:37,代码来源:wx_bass_control.py
示例12: listAudioOutputs
def listAudioOutputs(self):
# Returns a list of all local audio outputs
devices = {}
if not pybass.BASS_Init(0, 44100, 0, 0, 0):
if pybass.BASS_ErrorGetCode() != pybass.BASS_ERROR_ALREADY:
raise ValueError('BASS_Init Error: %s' % pybass.get_error_description(pybass.BASS_ErrorGetCode()))
maxDevicesReached = False
i = 0
while maxDevicesReached == False:
deviceInfo = pybass.BASS_DEVICEINFO()
device = pybass.BASS_GetDeviceInfo(i, deviceInfo)
if deviceInfo.flags == 0:
maxDevicesReached = True
else:
devices[i] = deviceInfo.name
i = i + 1
return devices
开发者ID:MediaRealm,项目名称:tempo,代码行数:24,代码来源:AudioPlayback.py
示例13: func_type
BASS_MIDI_FontLoad = func_type(ctypes.c_byte, HSOUNDFONT, ctypes.c_int, ctypes.c_int)(('BASS_MIDI_FontLoad', bassmidi_module))
#BOOL BASSMIDIDEF(BASS_MIDI_FontCompact)(HSOUNDFONT handle);
BASS_MIDI_FontCompact = func_type(ctypes.c_byte, HSOUNDFONT)(('BASS_MIDI_FontCompact', bassmidi_module))
#BOOL BASSMIDIDEF(BASS_MIDI_FontPack)(HSOUNDFONT handle, const void *outfile, const void *encoder, DWORD flags);
BASS_MIDI_FontPack = func_type(ctypes.c_byte, HSOUNDFONT, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_ulong)(('BASS_MIDI_FontPack', bassmidi_module))
#BOOL BASSMIDIDEF(BASS_MIDI_FontUnpack)(HSOUNDFONT handle, const void *outfile, DWORD flags);
BASS_MIDI_FontUnpack = func_type(ctypes.c_byte, HSOUNDFONT, ctypes.c_void_p, ctypes.c_ulong)(('BASS_MIDI_FontUnpack', bassmidi_module))
#BOOL BASSMIDIDEF(BASS_MIDI_FontSetVolume)(HSOUNDFONT handle, float volume);
BASS_MIDI_FontSetVolume = func_type(ctypes.c_byte, HSOUNDFONT, ctypes.c_float)(('BASS_MIDI_FontSetVolume', bassmidi_module))
#float BASSMIDIDEF(BASS_MIDI_FontGetVolume)(HSOUNDFONT handle);
BASS_MIDI_FontGetVolume = func_type(ctypes.c_float, HSOUNDFONT)(('BASS_MIDI_FontGetVolume', bassmidi_module))
if __name__ == "__main__":
if not pybass.BASS_Init(-1, 44100, 0, 0, 0):
print 'BASS_Init error', pybass.get_error_description(pybass.BASS_ErrorGetCode())
else:
font = BASS_MIDI_FontInit('test.sf2', 0)
if font == 0:
print 'BASS_MIDI_FontInit error', pybass.get_error_description(pybass.BASS_ErrorGetCode())
else:
font_info = BASS_MIDI_FONTINFO()
if BASS_MIDI_FontGetInfo(font, font_info):
print '============== SOUNDFONT Information =============='
print "name: %s\nloaded: %d / %d" % (font_info.name, font_info.samload, font_info.samsize)
handle = BASS_MIDI_StreamCreateFile(False, 'test.mid', 0, 0, 0, 44100)
pybass.play_handle(handle, False)
if BASS_MIDI_FontFree(font):
print 'BASS_MIDI_FontFree error', pybass.get_error_description(pybass.BASS_ErrorGetCode())
if not pybass.BASS_Free():
print 'BASS_Free error', pybass.get_error_description(pybass.BASS_ErrorGetCode())
开发者ID:FBSLikan,项目名称:TheQube,代码行数:31,代码来源:pybassmidi.py
示例14: BASSAC3DEF
bass_ac3_module = ctypes.CDLL('bass_ac3')
func_type = ctypes.CFUNCTYPE
# BASS_Set/GetConfig options
BASS_CONFIG_AC3_DYNRNG = 0x10001
# Additional BASS_AC3_StreamCreateFile/User/URL flags
BASS_AC3_DYNAMIC_RANGE = 0x800 # enable dynamic range compression
# BASS_CHANNELINFO type
BASS_CTYPE_STREAM_AC3 = 0x11000
#HSTREAM BASSAC3DEF(BASS_AC3_StreamCreateFile)(BOOL mem, const void *file, QWORD offset, QWORD length, DWORD flags);
BASS_AC3_StreamCreateFile = func_type(HSTREAM, ctypes.c_byte, ctypes.c_void_p, QWORD, QWORD, ctypes.c_ulong)(('BASS_AC3_StreamCreateFile', bass_ac3_module))
#HSTREAM BASSAC3DEF(BASS_AC3_StreamCreateURL)(const char *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user);
BASS_AC3_StreamCreateURL = func_type(HSTREAM, ctypes.c_char_p, ctypes.c_ulong, ctypes.c_ulong, DOWNLOADPROC, ctypes.c_void_p)(('BASS_AC3_StreamCreateURL', bass_ac3_module))
#HSTREAM BASSAC3DEF(BASS_AC3_StreamCreateFileUser)(DWORD system, DWORD flags, const BASS_FILEPROCS *procs, void *user);
BASS_AC3_StreamCreateFileUser = func_type(HSTREAM, ctypes.c_ulong, ctypes.c_ulong, ctypes.POINTER(BASS_FILEPROCS), ctypes.c_void_p)(('BASS_AC3_StreamCreateFileUser', bass_ac3_module))
if __name__ == "__main__":
if not pybass.BASS_Init(-1, 44100, 0, 0, 0):
print('BASS_Init error %s' % pybass.get_error_description(pybass.BASS_ErrorGetCode()))
else:
handle = BASS_AC3_StreamCreateFile(False, b'test.ac3', 0, 0, 0)
pybass.play_handle(handle)
if not pybass.BASS_Free():
print('BASS_Free error %s' % pybass.get_error_description(pybass.BASS_ErrorGetCode()))
开发者ID:syfenx,项目名称:pyBeats,代码行数:30,代码来源:pybass_ac3.py
示例15: __init__
def __init__(self, *args, **kwargs):
self.stream = kwargs.pop('stream', None)
self.name_stream = kwargs.pop('name_stream', 'memory_stream')
self.bass_handle = 0
wx.Panel.__init__(self, *args, **kwargs)
sizer_h = wx.BoxSizer(wx.HORIZONTAL)
self.btn_play = wx.Button(self, wx.ID_ANY, _('Play'), style = wx.NO_BORDER)
self.btn_play.SetToolTipString(_('Play media data'))
self.Bind(wx.EVT_BUTTON, self.event_play, self.btn_play)
sizer_h.Add(self.btn_play)
self.btn_stop = wx.Button(self, wx.ID_ANY, _('Stop'), style = wx.NO_BORDER)
self.Bind(wx.EVT_BUTTON, self.event_stop, self.btn_stop)
sizer_h.Add(self.btn_stop)
self.btn_open = wx.Button(self, wx.ID_OPEN, _('Open'), style = wx.NO_BORDER)
self.Bind(wx.EVT_BUTTON, self.event_open, self.btn_open)
sizer_h.Add(self.btn_open)
sizer_v = wx.BoxSizer(wx.VERTICAL)
self.status_line = Ticker(self, fgcolor = '#000062', bgcolor = '#7F7F8F', start = False, ppf = 1, fps = 50, direction = 'ltr')
sizer_v.Add(self.status_line, 0, wx.EXPAND)
self.slider = slider_ctrl(self, wx.ID_ANY, 0, 0, 0)
sizer_v.Add(self.slider, 0, wx.EXPAND)
sizer_v.Add(sizer_h)
self.SetSizer(sizer_v)
self.SetAutoLayout(True)
result = pybass.BASS_Init(-1, 44100, 0, 0, 0)
if not result:
bass_error_code = pybass.BASS_ErrorGetCode()
if bass_error_code != pybass.BASS_ERROR_ALREADY:
self.slider.Enable(False)
self.btn_play.Enable(False)
self.btn_stop.Enable(False)
print 'BASS_Init error', pybass.get_error_description(bass_error_code)
self.plugins = {}
self.plugins['aac'] = (pybass.BASS_PluginLoad('bass_aac.dll', 0), '|AAC|*.aac')
self.plugins['ac3'] = (pybass.BASS_PluginLoad('bass_ac3.dll', 0), '|AC3|*.ac3')
self.plugins['aix'] = (pybass.BASS_PluginLoad('bass_aix.dll', 0), '|AIX|*.aix')
self.plugins['ape'] = (pybass.BASS_PluginLoad('bass_ape.dll', 0), '|APE|*.ape')
self.plugins['mpc'] = (pybass.BASS_PluginLoad('bass_mpc.dll', 0), '|MPC|*.mpc')
self.plugins['ofr'] = (pybass.BASS_PluginLoad('bass_ofr.dll', 0), '|OFR|*.ofr')
self.plugins['spx'] = (pybass.BASS_PluginLoad('bass_spx.dll', 0), '|SPX|*.spx')
self.plugins['tta'] = (pybass.BASS_PluginLoad('bass_tta.dll', 0), '|TTA|*.tta')
self.plugins['cda'] = (pybass.BASS_PluginLoad('basscd.dll', 0), '|CDA|*.cda')
self.plugins['flac'] = (pybass.BASS_PluginLoad('bassflac.dll', 0), '|FLAC|*.flac')
self.plugins['wma'] = (pybass.BASS_PluginLoad('basswma.dll', 0), '|WMA, WMV|*.wma;*.wmv')
self.sound_font = 0
if pybassmidi:
sound_font_file_name = 'CT4MGM.SF2'
self.sound_font = pybassmidi.BASS_MIDI_FontInit(sound_font_file_name, 0)
if self.sound_font == 0:
print 'BASS_MIDI_FontInit error', pybass.get_error_description(pybass.BASS_ErrorGetCode()), ' (sound font file must be', sound_font_file_name, ')'
else:
self.plugins['midi'] = (pybass.BASS_PluginLoad('bassmidi.dll', 0), '|MID|*.mid')
else:
print 'pybassmidi module not accessible'
self.volume_slider = wx.Slider(self, wx.ID_ANY, pybass.BASS_GetVolume() * 100, 0, 100)
self.Bind(wx.EVT_SCROLL, self.event_volume_slider, self.volume_slider)
sizer_h.Add(self.volume_slider, 0, wx.EXPAND)
self.method_check_controls()
开发者ID:syfenx,项目名称:pyBeats,代码行数:72,代码来源:wx_bass_control.py
示例16: TAGS_GetLastErrorDesc
#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
#DWORD _stdcall TAGS_GetVersion();
TAGS_GetVersion = func_type(ctypes.c_ulong)(('TAGS_GetVersion', tags_module))
if __name__ == "__main__":
print 'TAGS implemented Version', TAGS_VERSION
print 'TAGS real Version', TAGS_GetVersion()
import pybass
if not pybass.BASS_Init(-1, 44100, 0, 0, 0):
print 'BASS_Init error', pybass.get_error_description(pybass.BASS_ErrorGetCode())
else:
handle = pybass.BASS_StreamCreateFile(False, 'test.ogg', 0, 0, 0)
if handle == 0:
print 'BASS_StreamCreateFile error', pybass.get_error_description(pybass.BASS_ErrorGetCode())
else:
fmt = '%IFV1(%ITRM(%TRCK),%ITRM(%TRCK). )%IFV2(%ITRM(%ARTI),%ICAP(%ITRM(%ARTI)),no artist) - %IFV2(%ITRM(%TITL),%ICAP(%ITRM(%TITL)),no title)%IFV1(%ITRM(%ALBM), - %IUPC(%ITRM(%ALBM)))%IFV1(%YEAR, %(%YEAR%))%IFV1(%ITRM(%GNRE), {%ITRM(%GNRE)})%IFV1(%ITRM(%CMNT), [%ITRM(%CMNT)])'
tags = TAGS_Read(handle, fmt)
print tags
if not pybass.BASS_StreamFree(handle):
print 'BASS_StreamFree error', pybass.get_error_description(pybass.BASS_ErrorGetCode())
if not pybass.BASS_Free():
print 'BASS_Free error', pybass.get_error_description(pybass.BASS_ErrorGetCode())
开发者ID:masonasons,项目名称:Twitrocity,代码行数:30,代码来源:pytags.py
示例17: BASSSPXDEF
if platform.system().lower() == "windows":
bass_spx_module = ctypes.WinDLL("bass_spx")
func_type = ctypes.WINFUNCTYPE
else:
bass_spx_module = ctypes.CDLL("bass_spx")
func_type = ctypes.CFUNCTYPE
# BASS_CHANNELINFO type
BASS_CTYPE_STREAM_SPX = 0x10C00
# HSTREAM BASSSPXDEF(BASS_SPX_StreamCreateFile)(BOOL mem, const void *file, QWORD offset, QWORD length, DWORD flags);
BASS_SPX_StreamCreateFile = func_type(HSTREAM, ctypes.c_byte, ctypes.c_void_p, QWORD, QWORD, ctypes.c_ulong)(
("BASS_SPX_StreamCreateFile", bass_spx_module)
)
# HSTREAM BASSSPXDEF(BASS_SPX_StreamCreateFileUser)(DWORD system, DWORD flags, const BASS_FILEPROCS *procs, void *user);
BASS_SPX_StreamCreateFileUser = func_type(
HSTREAM, ctypes.c_ulong, ctypes.c_ulong, ctypes.POINTER(BASS_FILEPROCS), ctypes.c_void_p
)(("BASS_SPX_StreamCreateFileUser", bass_spx_module))
if __name__ == "__main__":
if not pybass.BASS_Init(-1, 44100, 0, 0, 0):
print "BASS_Init error", pybass.get_error_description(pybass.BASS_ErrorGetCode())
else:
handle = BASS_SPX_StreamCreateFile(False, "test.spx", 0, 0, 0)
pybass.play_handle(handle)
if not pybass.BASS_Free():
print "BASS_Free error", pybass.get_error_description(pybass.BASS_ErrorGetCode())
开发者ID:02strich,项目名称:python-pandora-gui,代码行数:30,代码来源:pybass_spx.py
示例18: method_get_channel_info
def method_get_channel_info(self):
channel_info = pybass.BASS_CHANNELINFO()
if not pybass.BASS_ChannelGetInfo(self.bass_handle, channel_info):
print 'BASS_ChannelGetInfo error', pybass.get_error_description(pybass.BASS_ErrorGetCode())
return channel_info
开发者ID:syfenx,项目名称:pyBeats,代码行数:5,代码来源:wx_bass_control.py
示例19: method_set_position
def method_set_position(self, value):
if not pybass.BASS_ChannelSetPosition(self.bass_handle, value, pybass.BASS_POS_BYTE):
print 'BASS_ChannelSetPosition error', pybass.get_error_description(pybass.BASS_ErrorGetCode())
开发者ID:syfenx,项目名称:pyBeats,代码行数:3,代码来源:wx_bass_control.py
注:本文中的pybass.get_error_description函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论