Browse Source

fix cache and add examples folder

Nicolas Marcq 8 years ago
parent
commit
098024003e

+ 3 - 3
Docs/dev_env_install.md

@@ -29,14 +29,14 @@ pip install python-crontab
 ```
 
 ### Test your env
-Run the follwing command to capture audio from your microphone
+Run the following command to capture audio from your microphone
 ```
-
+rec test.wav
 ```
 
 Then play the recorded audio file
 ```
-
+play test.wav
 ```
 
 ## Installation

+ 1 - 1
brain_examples/fr/say_examples.yml

@@ -4,6 +4,6 @@
       - say:
           message:
             - "42"
-          tts: "pico2wave"
+          tts: "voxygen"
     signals:
       - order: "sens de la vie"

+ 1 - 1
core/Cache.py

@@ -24,7 +24,7 @@ class Cache:
         # fix UnicodeEncodeError: 'ascii' codec can't encode character X in position Y
         words = words.encode('utf-8')
         md5 = hashlib.md5(words).hexdigest()
-        filename = voice + "." + md5 + self._cache_extension
+        filename = voice + "." + md5 + "." + self._cache_extension
         cache_directory = os.path.join(self._cache_path, self._module_name, language)
         file_path = os.path.join(cache_directory, filename)
         FileManager.create_directory(cache_directory)

+ 1 - 0
core/Models/Neurone.py

@@ -39,6 +39,7 @@ class Neurone(object):
         tts = None
         if self.parameters is not None:
             tts = self.parameters.get('tts', None)
+            print "tts %s" % tts
 
         if tts is not None:
             self.tts = tts

+ 1 - 1
settings.yml

@@ -11,7 +11,7 @@ trigger:
 # This is the STT that will be used by default
 default_speech_to_text: "google"
 # This is the default TTS that will be used by JARVIS to talk.
-default_text_to_speech: "voxygen"
+default_text_to_speech: "pico2wave"
 
 # When jarvis detect the hotword/trigger, he will select randomly a phrase in the following list
 # to notify the user that he's listening for orders

+ 1 - 1
tts/pico2wave/pico2wave.py

@@ -12,7 +12,7 @@ class Pico2wave(TTS):
 
     def say(self, words=None, language=PICO2WAVE_LANGUAGES_DEFAULT, cache=False):
         language = self.get_voice(language)
-        file_path = self.cache.get_audio_file_cache_path(words, language=language)
+        file_path = self.cache.get_audio_file_cache_path(words, language=language, voice="default")
 
         self.get_audio(words, language, file_path)
         self.play_audio(file_path, cache=cache)