kalliope-project / kalliope

Kalliope is a framework that will help you to create your own personal assistant.
https://kalliope-project.github.io/
GNU General Public License v3.0
1.71k stars 230 forks source link

new core neuron 'play': play sound file #656

Closed juergenpabel closed 3 years ago

juergenpabel commented 3 years ago

Currently, no neuron exists to play an existing sound file. I added the core neuron 'play' with a parameter 'file' to implement this. At least my primary intention is to not output a TTS message upon being triggered, but rather an short jingle/notification sound.

For example:

  - name: "on-triggered-synapse"
    signals: []
    neurons:
      - play:
          file: "resources/signal/dong.wav"
Sispheor commented 3 years ago

Why not. Could you add the doc ?

juergenpabel commented 3 years ago

Added docs (and changed neuron parameter 'file' to 'filename')

juergenpabel commented 3 years ago

The travis 'docker' build fail with (not related to my PR): error: Werkzeug 0.16.1 is installed but Werkzeug>=2.0 is required by {'Flask', 'flask'}

Sispheor commented 3 years ago

Yes, flask team has released a new major version...

Could you update this line and this one with:

flask>=1.0.3,<2.0
juergenpabel commented 3 years ago

Done. And also modified PlayerModule.convert_mp3_to_wav to skip conversion if file has suffix ".wav" - this is not only and optimization but also addresses (presumably static) .wav files provided to the play neuron shouldn't be overwritten/modified by the player (as they aren't generated but part of the kalliope environment).

juergenpabel commented 3 years ago

What's the issue with flask 2.0 by the way? I have set up an environment that works with flask 2.0 and werkzeug 2.0.1 with no source changes in kalliope.

Sispheor commented 3 years ago

Thanks for your commits. We still have a dependency issue in the docker image. I'll try to fix it today and merge.

Sispheor commented 3 years ago

I'll fix docker tests later. Thanks for the PR.