Exemplo n.º 1
0
 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')
Exemplo n.º 2
0
 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')
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 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')
Exemplo n.º 5
0
 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)
Exemplo n.º 6
0
 def getWavStream(self,text):
     fpath = os.path.join(util.getTmpfs(),'speech.wav')
     self.runCommand(text,fpath)
     return open(fpath,'rb')
Exemplo n.º 7
0
 def getWavStream(self, text):
     fpath = os.path.join(util.getTmpfs(), 'speech.wav')
     self.runCommand(text, fpath)
     return open(fpath, 'rb')
Exemplo n.º 8
0
 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")
Exemplo n.º 9
0
 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')
Exemplo n.º 10
0
 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')