Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add offline tts using pico #5005

Merged
merged 9 commits into from
Jan 4, 2017
Merged

add offline tts using pico #5005

merged 9 commits into from
Jan 4, 2017

Conversation

doudz
Copy link
Contributor

@doudz doudz commented Dec 19, 2016

Description:
add offline tts using pico
it requires pico2wave to be install on the system, on debian like sudo apt install libttspico-utils

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#1706

Example entry for configuration.yaml (if applicable):

tts:
  - platform: picotts
    language: 'fr-FR'

Checklist:

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

finally:
os.remove(fname)
if data:
return ("wav", data)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no newline at end of file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated


class PicoProvider(Provider):
"""pico speech api provider."""

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line contains whitespace

@pvizeli
Copy link
Member

pvizeli commented Dec 20, 2016

Looks good. Finish all task they are open in your PR and fix lint

with open(fname, 'rb') as voice:
data = voice.read()
except OSError:
return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to return (None, None) to indicate nothing got returned.

with open(fname, 'rb') as voice:
data = voice.read()
except OSError:
_LOGGER.error("Error trying to read %s",fname)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing whitespace after ','

@pvizeli
Copy link
Member

pvizeli commented Dec 30, 2016

Please look at you Checklist and fix ie. all lint error and add a docu.

"""Load TTS using pico2wave."""
if language not in SUPPORT_LANGUAGES:
language = self.language
with tempfile.NamedTemporaryFile(suffix='.wav', delete=False) as tempfp:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (80 > 79 characters)

@pvizeli pvizeli self-assigned this Jan 4, 2017
@pvizeli pvizeli merged commit 9f65b8f into home-assistant:dev Jan 4, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Apr 30, 2017
@doudz doudz deleted the tts branch September 12, 2017 06:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants