Esempio n. 1
0
 def terminate(self):
     self.loop = False
     self.Messenger.send_message('terminating', 'macrobox_mfeats')
     # self.Messenger.send_message('terminating', CLIENT_ADDRESS)
     self.Messenger.terminate()
     self.Messenger._Thread__stop()
     for i in range(len(self.proclist)):
         self.proclist[i].proc.join()
     for i in range(len(self.proclist)):
         self.proclist[i].proc._Thread__stop()
     pybass.BASS_Free()
     kill_self_process()
Esempio n. 2
0
 def stop(self):
     if pybass:
         pybass.BASS_Free()
     if pyespeak:
         pyespeak.espeak_Terminate()
     if self.device:
         s = self.video_driver.getScreenSize()
         self.device.closeDevice()
         self.device = None
         if s.Width < 320:
             s.Width = 320
         if s.Height < 240:
             s.Height = 240
         self.config.set_many((('window_width', int(s.Width)),
                               ('window_height', int(s.Height))))
     self.config.close()
Esempio n. 3
0
BASS_WMA_EncodeOpenNetworkMulti = func_type(HWMENCODE, ctypes.c_ulong, ctypes.c_ulong, ctypes.c_ulong, ctypes.POINTER(ctypes.c_ulong), ctypes.c_ulong, ctypes.c_ulong)(('BASS_WMA_EncodeOpenNetworkMulti', basswma_module))
#HWMENCODE BASSWMADEF(BASS_WMA_EncodeOpenPublish)(DWORD freq, DWORD chans, DWORD flags, DWORD bitrate, const char *url, const char *user, const char *pass);
BASS_WMA_EncodeOpenPublish = func_type(HWMENCODE, ctypes.c_ulong, ctypes.c_ulong, ctypes.c_ulong, ctypes.c_ulong, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p)(('BASS_WMA_EncodeOpenPublish', basswma_module))
#HWMENCODE BASSWMADEF(BASS_WMA_EncodeOpenPublishMulti)(DWORD freq, DWORD chans, DWORD flags, const DWORD *bitrates, const char *url, const char *user, const char *pass);
BASS_WMA_EncodeOpenPublishMulti = func_type(HWMENCODE, ctypes.c_ulong, ctypes.c_ulong, ctypes.c_ulong, ctypes.POINTER(ctypes.c_ulong), ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p)(('BASS_WMA_EncodeOpenPublishMulti', basswma_module))
#DWORD BASSWMADEF(BASS_WMA_EncodeGetPort)(HWMENCODE handle);
BASS_WMA_EncodeGetPort = func_type(ctypes.c_ulong, HWMENCODE)(('BASS_WMA_EncodeGetPort', basswma_module))
#BOOL BASSWMADEF(BASS_WMA_EncodeSetNotify)(HWMENCODE handle, CLIENTCONNECTPROC *proc, void *user);
BASS_WMA_EncodeSetNotify = func_type(ctypes.c_byte, HWMENCODE, CLIENTCONNECTPROC, ctypes.c_void_p)(('BASS_WMA_EncodeSetNotify', basswma_module))
#DWORD BASSWMADEF(BASS_WMA_EncodeGetClients)(HWMENCODE handle);
BASS_WMA_EncodeGetClients = func_type(ctypes.c_ulong, HWMENCODE)(('BASS_WMA_EncodeGetClients', basswma_module))
#BOOL BASSWMADEF(BASS_WMA_EncodeSetTag)(HWMENCODE handle, const char *tag, const char *text, DWORD form);
BASS_WMA_EncodeSetTag = func_type(ctypes.c_byte, HWMENCODE, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_ulong)(('BASS_WMA_EncodeSetTag', basswma_module))
#BOOL BASSWMADEF(BASS_WMA_EncodeWrite)(HWMENCODE handle, const void *buffer, DWORD length);
BASS_WMA_EncodeWrite = func_type(ctypes.c_byte, HWMENCODE, ctypes.c_void_p, ctypes.c_ulong)(('BASS_WMA_EncodeWrite', basswma_module))
#BOOL BASSWMADEF(BASS_WMA_EncodeClose)(HWMENCODE handle);
BASS_WMA_EncodeClose = func_type(ctypes.c_byte, HWMENCODE)(('BASS_WMA_EncodeClose', basswma_module))

#void *BASSWMADEF(BASS_WMA_GetWMObject)(DWORD handle);
BASS_WMA_GetWMObject = func_type(ctypes.c_void_p, ctypes.c_ulong)(('BASS_WMA_GetWMObject', basswma_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_WMA_StreamCreateFile(False, b'test.wma', 0, 0, 0)
		pybass.play_handle(handle)
		if not pybass.BASS_Free():
			print('BASS_Free error %s' % pybass.get_error_description(pybass.BASS_ErrorGetCode()))
Esempio n. 4
0
def free():
    """
Free BASS
    """
    dll.BASS_Free()