def getWavStream(self,text): wav_path = os.path.join(util.getTmpfs(),'speech.wav') mp3_path = os.path.join(util.getTmpfs(),'speech.mp3') self.runCommand(text,mp3_path) self.process = subprocess.Popen(['mpg123','-w',wav_path,mp3_path],stdout=(open(os.path.devnull, 'w')), stderr=subprocess.STDOUT) while self.process.poll() == None and self.active: util.sleep(10) os.remove(mp3_path) return open(wav_path,'rb')
def getWavStream(self, text): wav_path = os.path.join(util.getTmpfs(), 'speech.wav') mp3_path = os.path.join(util.getTmpfs(), 'speech.mp3') self.runCommand(text, mp3_path) self.process = subprocess.Popen(['mpg123', '-w', wav_path, mp3_path], stdout=(open(os.path.devnull, 'w')), stderr=subprocess.STDOUT) while self.process.poll() == None and self.active: util.sleep(10) os.remove(mp3_path) return open(wav_path, 'rb')
def setOutDir(self): tmpfs = util.getTmpfs() if util.getSetting('use_tmpfs',True) and tmpfs: util.LOG('Using tmpfs at: {0}'.format(tmpfs)) self.outDir = os.path.join(tmpfs,'xbmc_speech') else: self.outDir = os.path.join(util.profileDirectory(),'xbmc_speech') if not os.path.exists(self.outDir): os.makedirs(self.outDir)
def getWavStream(self, text): wav_path = os.path.join(util.getTmpfs(), 'speech.wav') subprocess.call([ 'say', '-o', wav_path, '--file-format', 'WAVE', '--data-format', 'LEI16@22050', text.encode('utf-8') ]) return open(wav_path, 'rb')
def setOutDir(self): tmpfs = util.getTmpfs() if util.getSetting('use_tmpfs', True) and tmpfs: util.LOG('Using tmpfs at: {0}'.format(tmpfs)) self.outDir = os.path.join(tmpfs, 'xbmc_speech') else: self.outDir = os.path.join(util.profileDirectory(), 'xbmc_speech') if not os.path.exists(self.outDir): os.makedirs(self.outDir)
def getWavStream(self,text): fpath = os.path.join(util.getTmpfs(),'speech.wav') self.runCommand(text,fpath) return open(fpath,'rb')
def getWavStream(self, text): fpath = os.path.join(util.getTmpfs(), 'speech.wav') self.runCommand(text, fpath) return open(fpath, 'rb')
def getWavStream(self, text): wav_path = os.path.join(util.getTmpfs(), "speech.wav") subprocess.call( ["say", "-o", wav_path, "--file-format", "WAVE", "--data-format", "LEI16@22050", text.encode("utf-8")] ) return open(wav_path, "rb")
def getWavStream(self, text): wav_path = os.path.join(util.getTmpfs(), 'speech.wav') if not self.runCommand(text, wav_path): return None return open(wav_path, 'rb')
def getWavStream(self,text): wav_path = os.path.join(util.getTmpfs(),'speech.wav') if not self.runCommand(text,wav_path): return None return open(wav_path,'rb')