def Run(self, ms=None): """ Service run method. Acquires the audio2 player objects, initializes some internal stuff, and hooks up the Windows session change handler. Also hooks up the Jukebox player object so that we receive track-change events from Wise. ARGUMENTS: ms Legacy. No idea what this does. """ self.active = False self.manager = AudioManager( audiomanager.InitializeAudioManager(session.languageID), eveaudio.EVE_COMMON_BANKS) self.banksLoaded = False enabled = self.AppGetSetting('audioEnabled', 1) self.uiPlayer = self.jukeboxPlayer = None self.busChannels = {} for i in xrange(8): self.busChannels[i] = None trinity.SetDirectSoundPtr(audio2.GetDirectSoundPtr()) if self.AppGetSetting('forceEnglishVoice', False): io = audio2.AudLowLevelIO(u'res:/Audio/') self.manager.manager.config.lowLevelIO = io if enabled: self.Activate()
def Run(self, ms=None): self.active = False self.manager = audio2.GetManager() aPath = blue.paths.ResolvePath(u'res:/Audio') io = audio2.AudLowLevelIO( aPath, LANGUAGE_ID_TO_BANK.get(session.languageID, u'')) initConf = audio2.AudConfig() initConf.lowLevelIO = io initConf.numRefillsInVoice = 8 initConf.asyncFileOpen = True self.manager.config = initConf self.banksLoaded = False enabled = self.AppGetSetting('audioEnabled', 1) self.uiPlayer = self.jukeboxPlayer = None self.busChannels = {} for i in xrange(8): self.busChannels[i] = None self.audioEmitterComponentsByScene = collections.defaultdict(dict) self.audioEmitterPositionsByComponent = {} self.audioEmitterComponentGroupsByScene = collections.defaultdict( lambda: collections.defaultdict(list)) trinity.SetDirectSoundPtr(audio2.GetDirectSoundPtr()) self.AppRun() if enabled: self.Activate() self.obstructionPollThreadWR = None
def InitializeAudioManager(languageID): manager = audio2.GetManager() io = audio2.AudLowLevelIO(u'res:/Audio/', LANGUAGE_ID_TO_BANK.get(languageID, u'')) initConf = audio2.AudConfig() initConf.lowLevelIO = io initConf.numRefillsInVoice = 8 initConf.asyncFileOpen = True manager.config = initConf return manager
def init(): aPath = blue.paths.ResolvePath(u'res:/Audio') print 'aPath:', aPath io = audio2.AudLowLevelIO(aPath, u'') initConf = audio2.AudConfig() initConf.lowLevelIO = io initConf.numRefillsInVoice = 8 initConf.asyncFileOpen = True manager.config = initConf manager.SetEnabled(True)
def Run(self, ms = None): self.active = False self.manager = AudioManager(audiomanager.InitializeAudioManager(session.languageID), eveaudio.EVE_COMMON_BANKS) self.banksLoaded = False enabled = self.AppGetSetting('audioEnabled', 1) self.uiPlayer = self.jukeboxPlayer = None self.busChannels = {} for i in xrange(8): self.busChannels[i] = None if self.AppGetSetting('forceEnglishVoice', False): io = audio2.AudLowLevelIO(u'res:/Audio/') self.manager.manager.config.lowLevelIO = io if enabled: self.Activate()
def AppRun(self): if self.AppGetSetting('forceEnglishVoice', False): aPath = blue.paths.ResolvePath(u'res:/Audio') io = audio2.AudLowLevelIO(aPath) self.manager.config.lowLevelIO = io