Commit Graph

102 Commits (60ab1aab69996ee756bd124abf19d5f3b4ff83db)

Author SHA1 Message Date
jarbasal 15141528bd vlc audio length check 2019-01-12 13:10:54 +01:00
jarbasal 1c3543f5e5 Support for audio seek
The audioservice can now jump forward and backward in the audio stream/file

The functionality is accessed via the audioservice class's seek_forward(),
seek_backward() and seek() methods
2019-01-12 13:10:54 +01:00
Åke Forslund 38701a9790 Remove inheritance from object
Inheriting from object isn't necessary in python3.
2019-01-11 09:24:21 +01:00
Åke Forslund 8859ff1d3b Don't stop audio right after play start
The common play skill sends a stop message in the CPS_start(), if the play message is sent too close to the stop message it may be executed before the stop message causing playback to immediately stop.

To circumvent this a 1 second stop ignore time is added.
2018-11-15 13:57:17 +01:00
Michael Nguyen b22e9d975d fall back tts function for connection errors 2018-10-08 16:54:22 -05:00
Åke f091f44c85 Audioservice repeat (#1805)
* Add repeat option to audioservice

The audioservice.play() method now accepts a repeat parameter. If this
parameter is True the playlist passed to the audio service will be
repeated.

* Add repeat support to vlc

* Add the repeat parameter to all services

Not functional but playback will work at least. Hacktoberfest?
2018-09-24 15:12:12 -05:00
Åke 5c25af000c Fix chromecast audio backend (#1790) 2018-09-10 13:20:38 -05:00
Åke bd7cd7daee Bugfix/simple audioservice (#1774)
* Use correct method to guess mime type

* Use the commands from mycroft.conf

- Remove hardcoded commands and use the ones from mycroft.util to handle
configurations.
- Improve error handling
2018-08-29 14:25:53 -05:00
Steve Penrod 97138ae403 Address Python 3 changes 2018-08-28 12:41:59 -05:00
Åke Forslund c4afe7429a Rename emitter "bus" for consistency 2018-08-23 09:03:53 +02:00
Åke Forslund 7b4c6ed583 Audio service mimetypes
Add possibility for mimetypes to be passed with each track.
Make simple audio service try to detect mime type if missing
2018-08-23 08:41:01 +02:00
Josh Cox c57fcfe328 Add Simple audio backend
Uses simple command line tools to play audio. This replaces the mpg123 and the pogg123 backends.
2018-08-23 08:41:01 +02:00
Åke 64476eb143 Replace emitter/ws with bus (#1757)
Makes the code a bit more understandable
2018-08-21 20:50:50 -05:00
Åke Forslund 6fa17dbed3 Separate AudioService from main 2018-08-16 20:45:17 +02:00
Åke Forslund a66e23d8ab start processess using python -m
- rename process main.py to __main__.py
- update start-mycroft.sh/stop-mycroft.sh scripts to reflect the change
2018-08-16 15:21:22 +02:00
Åke 41fec03d80 Add retry limit for chromecast detection (#1729)
Limit the connection tries to 2 and lower the timeout to 5 seconds.
2018-08-15 03:44:24 -05:00
JarbasAI 65fcfcfcff remove isSpeaking signal on audio startup (#1721)
* remove isSpeaking signal on audio startup

* clean import
2018-08-14 22:07:59 -05:00
Josh Cox 2abb8fa74b Add Ogg123 support (#1678)
This is reimplementation of #1649 which became divergent.

## Description
Adds a Ogg123Service and a play_ogg exactly like Mpg123Service and play_mp3

## How to test
I have a skill for a podcast which does not have an mp3 feed:
https://github.com/joshuacox/skill-GNUworldOrder

## Contributor license agreement signed?
signed by @joshuacox
2018-07-26 22:25:39 -05:00
Michael Nguyen fb2a6209ee
Merge pull request #1506 from forslund/feature/vlc-update
Feature/vlc update
2018-07-18 11:28:33 -05:00
Åke 14349cfb25 Remove stray lock.release() (#1680)
This fixes a stray lock.release() causing a silent

RuntimeError: release unlocked lock

after TTS execution but just before reporting the timing for the TTS system.
2018-07-10 12:28:45 -05:00
Åke Forslund 0ae9ccda9a Make vlc ducking configurable 2018-07-10 11:21:33 +02:00
Åke Forslund 8f979df5b1 Reduce log level to debug 2018-07-10 11:21:33 +02:00
Åke Forslund 78dbdf1fb0 Restore volume when stopping playback 2018-07-10 11:20:41 +02:00
Åke Forslund bb2c727485 Add comments and basic docstrings 2018-07-10 11:19:54 +02:00
Åke Forslund 775c536de5 Fix vlc lowering volume while not playing. 2018-07-10 11:19:54 +02:00
Åke f8eb7587df Handle stop correctly in the audio service. (#1677)
* Handle stop correctly in the audio service.

This allows for example the news skill playback to be stopped without
the listening being triggered.

* Handle case where service stops at end of playlist

- Fix issue when receiving multiple stop signals
- Stop method of services now returns True or False depending on if audio was playing
2018-07-10 03:23:41 -05:00
Steve Penrod 17aab53fae Enhance the behavior of the Mark 1 button (#1668)
The Mark 1 button press can now be "consumed" when a skill handles
the Stop command.  When this happens, the button press will not
trigger listening mode.  An additional press would be needed to
trigger listening.

This introduces the "mycroft.stop.handled" messagebus message.  It
carries a data field called "by" which identifies who handled it.
Currently the values are "TTS" for when speaking ends or the name
of a skill which implements Stop and returns True from the call.

Also fixed a potential bug when the flag to clear queued visemes
was left set after a button press.
2018-07-05 20:56:54 +02:00
nabice c35d065299 Fix wrong variable name 2018-05-30 15:27:47 +08:00
Åke Forslund 04b81a7380 Add shutdown method to chromecast
The default method for the services call stop, in the chromecast case this isn't desirable since any playing application would be shutdown (even if mycroft didn't initiate it).

This overrides default behaviour and will merely disconnect from the device at shutdown.
2018-05-23 14:04:15 +02:00
Matthew D. Scholefield ac26131b71 Fix SSML when tag spans multiple sentences
Now, sentence splitting is disabled if the utterance contains any xml tags
2018-04-18 14:45:09 -05:00
Matthew D. Scholefield cbf73d4b30 SSML Changes
- Engines now specify if they support ssml rather than the configuration
 - The text client strips out ssml tags
 - Engines can modify tags via the `self.modify_tag` method
2018-04-18 14:45:09 -05:00
Jarbas 7c6af2017c add SSML support 2018-04-18 14:45:09 -05:00
Matthew D. Scholefield 10bd9a1cf3 Change initial kill to SIGINT
This sends a ctrl+c signal to each process which will allow code to exit properly by handling KeyboardInterrupt
Other notable changes:
 - create_daemon method used to clean up create daemon threads
 - create_echo_function used to reduce code duplication with messagebus
 echo functions
 - wait_for_exit_signal used to wait for ctrl+c (SIGINT)
 - reset_sigint_handler used to ensure SIGINT will raise KeyboardInterrupt
2018-04-11 21:29:10 -05:00
Åke Forslund 2e0a622447 Log exception and exception message 2018-03-28 15:38:14 -05:00
Åke Forslund 26d6e674df Reduce audio service logging verbosity
- Duplicates removed
- Many debugging messages reduced to debug level
2018-03-28 15:38:14 -05:00
jarbasai 24d022d00a active flag 2018-03-27 18:08:49 +02:00
jarbasai 5905a6460b Add mplayer audio backend 2018-03-27 18:08:32 +02:00
jarbasai 8d277747a9 honor "active" flag for audio backends
The backends are active by default, but can be enforced or disabled with
the active flag.
2018-03-22 04:44:56 +01:00
jarbasai 6fefac1c88 add stop 2018-03-22 04:17:33 +01:00
jarbasai 7b4a3b49ed clean shutdown 2018-03-22 04:17:24 +01:00
jarbasai a865930fd7 fix previous 2018-03-17 16:23:21 +00:00
Åke 50b05ae6b4
Merge pull request #1446 from MycroftAI/refactor/exceptions
Remove redundant except (SystemExit, KeyboardInterrupt) clauses
2018-02-27 23:08:27 +01:00
Matthew D. Scholefield 98eaa83db8 Fix audio service loading
If service_module failed to load, it shouldn't continue loading it
2018-02-27 14:37:37 -06:00
Matthew D. Scholefield fbb9231adc Remove redundant except (SystemExit, KeyboardInterrupt) clauses
This can be replaced by ensuring the final except clause is 'except Exceptions'. This works because SystemExit and KeyboardInterrupt do not inherit from the base 'Exception' class
2018-02-27 14:28:29 -06:00
penrods c68ad44b1c Internal documentation, typos, remove misleading message
* Made MycroftSkill.remove_event() return a bool, preventing unnecessary/misleading message from being posted by MycroftSkill.cancel_scheduled_event()
* More doc and several minor renames around intent processing
* Several minor typo and doc corrections
2018-02-13 02:54:12 -06:00
Augusto Monteiro dd0012c2a1
Merge pull request #1367 from forslund/feature/track-start-message
Add message on track start
2018-02-07 12:56:05 -03:00
Åke f0e695bbc4 Feature/metrics classes (#1393)
* Report type of TTS when reporting tts metrics

* Report type of STT when reporting stt metrics
2018-02-01 02:35:27 -06:00
Åke Forslund 12da2070b2 Add message on track start
====  Tech Notes ====
When a new track starts playing the audio service will send a message
indicating which track has started.

==== Protocol Notes ====
"mycroft.audio.service.track_start" message added
2018-01-17 15:15:23 +01:00
Åke Forslund 936bd54180 Add a function to build the standard timing report 2018-01-08 18:01:03 -06:00
Åke Forslund c1d3342fc6 Add playback timing reports in playback thread
This covers the default case with mimic and in the future more as they
are moved over to using the playback thread
2018-01-08 18:01:03 -06:00