Skip to content

Commit

Permalink
Set UI to trigger even when failed to reach server
Browse files Browse the repository at this point in the history
Add connection restart wav files for indicators
Remove timeout and timeout extensions
Reduce latency in response
Cleanup unwanted objects
  • Loading branch information
dormant-user committed May 6, 2023
1 parent 6471ed9 commit 8c6b7a8
Show file tree
Hide file tree
Showing 24 changed files with 179 additions and 309 deletions.
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ if __name__ == '__main__':
### Optional Env Vars
- **DEBUG**: Defaults to `False` - _Enable debug level logging_
<br><br>
- **REQUEST_TIMEOUT**: Defaults to `5` - _Timeout for API calls_
- **SPEECH_TIMEOUT**: Defaults to `0` for macOS, `5` for Windows - _Timeout for speech synthesis_
- **SPEECH_TIMEOUT**: Defaults to `0` for macOS, `10` for Windows - _Timeout for speech synthesis_
<br><br>
- **NATIVE_AUDIO**: Defaults to `False` - _If set to `True`, the response is generated in the server's default voice_
- **WAKE_WORDS**: Defaults to `jarvis` (Defaults to `alexa` in macOS older than `10.14`) - _Wake words to initiate Jarvis_
Expand All @@ -44,12 +43,6 @@ if __name__ == '__main__':
<br><br>
- **VOICE_TIMEOUT**: Defaults to `3` - _Timeout for listener once wake word is detected - Awaits for a speech to begin until this limit_
- **VOICE_PHRASE_LIMIT**: Defaults to `None` - _Timeout for phrase once listener is activated - Listener will be deactivated after this limit_
<br><br>
- **RESTART_TIMER**: Defaults to 24 hours.
- I have a proxy tunneling my `localhost` from Jarvis server.
- I have a CDN setup that's allowing me to access the tunnel with a custom domain.
- Since I don't want my CDN to take the hit, and the tunnel origin changes often, I'm swapping the URL upon startup.
- This requires restarting the UI every now and then.

**Custom settings for speech recognition**

Expand Down
7 changes: 7 additions & 0 deletions doc_generator/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ Exceptions
:members:
:undoc-members:

Display
=======

.. automodule:: jarvis_ui.executables.display
:members:
:undoc-members:

Indices and tables
==================

Expand Down
14 changes: 2 additions & 12 deletions docs/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ <h2>Optional Env Vars<a class="headerlink" href="#optional-env-vars" title="Perm
<ul class="simple">
<li><p><strong>DEBUG</strong>: Defaults to <code class="docutils literal notranslate"><span class="pre">False</span></code> - <em>Enable debug level logging</em>
<br><br></p></li>
<li><p><strong>REQUEST_TIMEOUT</strong>: Defaults to <code class="docutils literal notranslate"><span class="pre">5</span></code> - <em>Timeout for API calls</em></p></li>
<li><p><strong>SPEECH_TIMEOUT</strong>: Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code> for macOS, <code class="docutils literal notranslate"><span class="pre">5</span></code> for Windows - <em>Timeout for speech synthesis</em>
<li><p><strong>SPEECH_TIMEOUT</strong>: Defaults to <code class="docutils literal notranslate"><span class="pre">0</span></code> for macOS, <code class="docutils literal notranslate"><span class="pre">10</span></code> for Windows - <em>Timeout for speech synthesis</em>
<br><br></p></li>
<li><p><strong>NATIVE_AUDIO</strong>: Defaults to <code class="docutils literal notranslate"><span class="pre">False</span></code> - <em>If set to <code class="docutils literal notranslate"><span class="pre">True</span></code>, the response is generated in the server’s default voice</em></p></li>
<li><p><strong>WAKE_WORDS</strong>: Defaults to <code class="docutils literal notranslate"><span class="pre">jarvis</span></code> (Defaults to <code class="docutils literal notranslate"><span class="pre">alexa</span></code> in macOS older than <code class="docutils literal notranslate"><span class="pre">10.14</span></code>) - <em>Wake words to initiate Jarvis</em></p></li>
Expand All @@ -88,16 +87,7 @@ <h2>Optional Env Vars<a class="headerlink" href="#optional-env-vars" title="Perm
<li><p><strong>VOICE_RATE</strong>: Defaults to the value from <code class="docutils literal notranslate"><span class="pre">pyttsx3</span></code> module - <em>Speed/rate at which the text should be spoken</em>
<br><br></p></li>
<li><p><strong>VOICE_TIMEOUT</strong>: Defaults to <code class="docutils literal notranslate"><span class="pre">3</span></code> - <em>Timeout for listener once wake word is detected - Awaits for a speech to begin until this limit</em></p></li>
<li><p><strong>VOICE_PHRASE_LIMIT</strong>: Defaults to <code class="docutils literal notranslate"><span class="pre">None</span></code> - <em>Timeout for phrase once listener is activated - Listener will be deactivated after this limit</em>
<br><br></p></li>
<li><p><strong>RESTART_TIMER</strong>: Defaults to 24 hours.</p>
<ul>
<li><p>I have a proxy tunneling my <code class="docutils literal notranslate"><span class="pre">localhost</span></code> from Jarvis server.</p></li>
<li><p>I have a CDN setup that’s allowing me to access the tunnel with a custom domain.</p></li>
<li><p>Since I don’t want my CDN to take the hit, and the tunnel origin changes often, I’m swapping the URL upon startup.</p></li>
<li><p>This requires restarting the UI every now and then.</p></li>
</ul>
</li>
<li><p><strong>VOICE_PHRASE_LIMIT</strong>: Defaults to <code class="docutils literal notranslate"><span class="pre">None</span></code> - <em>Timeout for phrase once listener is activated - Listener will be deactivated after this limit</em></p></li>
</ul>
<p><strong>Custom settings for speech recognition</strong></p>
<p>These are customized according to the author’s voice pitch.
Expand Down
9 changes: 1 addition & 8 deletions docs/_sources/README.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ if __name__ == '__main__':
### Optional Env Vars
- **DEBUG**: Defaults to `False` - _Enable debug level logging_
<br><br>
- **REQUEST_TIMEOUT**: Defaults to `5` - _Timeout for API calls_
- **SPEECH_TIMEOUT**: Defaults to `0` for macOS, `5` for Windows - _Timeout for speech synthesis_
- **SPEECH_TIMEOUT**: Defaults to `0` for macOS, `10` for Windows - _Timeout for speech synthesis_
<br><br>
- **NATIVE_AUDIO**: Defaults to `False` - _If set to `True`, the response is generated in the server's default voice_
- **WAKE_WORDS**: Defaults to `jarvis` (Defaults to `alexa` in macOS older than `10.14`) - _Wake words to initiate Jarvis_
Expand All @@ -44,12 +43,6 @@ if __name__ == '__main__':
<br><br>
- **VOICE_TIMEOUT**: Defaults to `3` - _Timeout for listener once wake word is detected - Awaits for a speech to begin until this limit_
- **VOICE_PHRASE_LIMIT**: Defaults to `None` - _Timeout for phrase once listener is activated - Listener will be deactivated after this limit_
<br><br>
- **RESTART_TIMER**: Defaults to 24 hours.
- I have a proxy tunneling my `localhost` from Jarvis server.
- I have a CDN setup that's allowing me to access the tunnel with a custom domain.
- Since I don't want my CDN to take the hit, and the tunnel origin changes often, I'm swapping the URL upon startup.
- This requires restarting the UI every now and then.

**Custom settings for speech recognition**

Expand Down
7 changes: 7 additions & 0 deletions docs/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ Exceptions
:members:
:undoc-members:

Display
=======

.. automodule:: jarvis_ui.executables.display
:members:
:undoc-members:

Indices and tables
==================

Expand Down
49 changes: 24 additions & 25 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,13 @@ <h2 id="C">C</h2>
</li>
<li><a href="index.html#jarvis_ui.modules.peripherals.ChannelType">ChannelType (class in jarvis_ui.modules.peripherals)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#jarvis_ui.modules.playsound.PlayAudio.close">close() (jarvis_ui.modules.playsound.PlayAudio method)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#jarvis_ui.modules.config.Config">Config (class in jarvis_ui.modules.config)</a>
</li>
<li><a href="index.html#jarvis_ui.modules.models.FileIO.connection_restart">connection_restart (jarvis_ui.modules.models.FileIO attribute)</a>
</li>
<li><a href="index.html#jarvis_ui.modules.logger.console_logger">console_logger() (in module jarvis_ui.modules.logger)</a>
</li>
Expand Down Expand Up @@ -146,7 +148,7 @@ <h2 id="F">F</h2>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#jarvis_ui.modules.models.FileIO">FileIO (class in jarvis_ui.modules.models)</a>
</li>
<li><a href="index.html#jarvis_ui.modules.models.Flag">Flag (class in jarvis_ui.modules.models)</a>
<li><a href="index.html#jarvis_ui.executables.display.flush_screen">flush_screen() (in module jarvis_ui.executables.display)</a>
</li>
</ul></td>
</tr></table>
Expand Down Expand Up @@ -181,6 +183,13 @@ <h2 id="J">J</h2>

<ul>
<li><a href="index.html#module-jarvis_ui.executables.api_handler">module</a>
</li>
</ul></li>
<li>
jarvis_ui.executables.display

<ul>
<li><a href="index.html#module-jarvis_ui.executables.display">module</a>
</li>
</ul></li>
<li>
Expand All @@ -204,15 +213,15 @@ <h2 id="J">J</h2>
<li><a href="index.html#module-jarvis_ui.executables.starter">module</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
jarvis_ui.main

<ul>
<li><a href="index.html#module-jarvis_ui.main">module</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
jarvis_ui.modules.exceptions

Expand Down Expand Up @@ -268,6 +277,8 @@ <h2 id="M">M</h2>

<ul>
<li><a href="index.html#module-jarvis_ui.executables.api_handler">jarvis_ui.executables.api_handler</a>
</li>
<li><a href="index.html#module-jarvis_ui.executables.display">jarvis_ui.executables.display</a>
</li>
<li><a href="index.html#module-jarvis_ui.executables.listener">jarvis_ui.executables.listener</a>
</li>
Expand Down Expand Up @@ -348,22 +359,12 @@ <h2 id="R">R</h2>
</li>
<li><a href="index.html#jarvis_ui.modules.models.EnvConfig.request_url">request_url (jarvis_ui.modules.models.EnvConfig attribute)</a>
</li>
<li><a href="index.html#jarvis_ui.modules.models.FileIO.restart">restart (jarvis_ui.modules.models.FileIO attribute)</a>

<ul>
<li><a href="index.html#jarvis_ui.modules.models.Flag.restart">(jarvis_ui.modules.models.Flag attribute)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#jarvis_ui.modules.models.EnvConfig.restart_attempts">restart_attempts (jarvis_ui.modules.models.EnvConfig attribute)</a>
<li><a href="index.html#jarvis_ui.modules.models.FileIO.restart">restart (jarvis_ui.modules.models.FileIO attribute)</a>
</li>
<li><a href="index.html#jarvis_ui.modules.models.EnvConfig.restart_timer">restart_timer (jarvis_ui.modules.models.EnvConfig attribute)</a>

<ul>
<li><a href="index.html#jarvis_ui.modules.models.RestartTimer.restart_timer">(jarvis_ui.modules.models.RestartTimer attribute)</a>
<li><a href="index.html#jarvis_ui.modules.models.RestartTimer.restart_timer">restart_timer (jarvis_ui.modules.models.RestartTimer attribute)</a>
</li>
</ul></li>
<li><a href="index.html#jarvis_ui.modules.models.RestartTimer">RestartTimer (class in jarvis_ui.modules.models)</a>
</li>
<li><a href="index.html#jarvis_ui.modules.playsound.PlayAudio.run">run() (jarvis_ui.modules.playsound.PlayAudio method)</a>
Expand All @@ -385,11 +386,11 @@ <h2 id="S">S</h2>
</li>
</ul></li>
<li><a href="index.html#jarvis_ui.modules.models.Settings">Settings (class in jarvis_ui.modules.models)</a>
</li>
<li><a href="index.html#jarvis_ui.modules.models.FileIO.shutdown">shutdown (jarvis_ui.modules.models.FileIO attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#jarvis_ui.modules.models.FileIO.shutdown">shutdown (jarvis_ui.modules.models.FileIO attribute)</a>
</li>
<li><a href="index.html#jarvis_ui.executables.speaker.speak">speak() (in module jarvis_ui.executables.speaker)</a>
</li>
<li><a href="index.html#jarvis_ui.modules.models.EnvConfig.speech_timeout">speech_timeout (jarvis_ui.modules.models.EnvConfig attribute)</a>
Expand All @@ -402,8 +403,6 @@ <h2 id="S">S</h2>
<li><a href="index.html#jarvis_ui.executables.starter.Activator.start">(jarvis_ui.executables.starter.Activator method)</a>
</li>
</ul></li>
<li><a href="index.html#jarvis_ui.modules.models.Flag.stop">stop (jarvis_ui.modules.models.Flag attribute)</a>
</li>
</ul></td>
</tr></table>

Expand Down Expand Up @@ -451,11 +450,11 @@ <h2 id="W">W</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#jarvis_ui.modules.models.EnvConfig.wake_words">wake_words (jarvis_ui.modules.models.EnvConfig attribute)</a>

<ul>
<li><a href="index.html#jarvis_ui.modules.models.Settings.wake_words">(jarvis_ui.modules.models.Settings attribute)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#jarvis_ui.executables.display.write_screen">write_screen() (in module jarvis_ui.executables.display)</a>
</li>
</ul></td>
</tr></table>

Expand Down
Loading

0 comments on commit 8c6b7a8

Please sign in to comment.