Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
andlo committed Oct 22, 2018
1 parent 26c1476 commit 435246a
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 25 deletions.
33 changes: 25 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
## Auto Set Volume
Sets the volume level to auto
# <img src='https://rawgithub.com/FortAwesome/Font-Awesome/master/advanced-options/raw-svg/solid/volume-up.svg' card_color='#F66716' width='50' height='50' style='vertical-align:bottom'/> Auto volume
Sets the volume after surounding noice level

## Description
This skill sets the volume level automatly depending how much noice is in the room. if there is much noice volume is set high and if quiet the level is low.
## About
This skill lets Mycroft deside when to use high, normal or low volume. Mycrofts keeps monitoring the mic level, and from that deside what volume level is right to use.

## Examples
- "Set volume level to auto"
As it is not easy to know what is high and what is low noice level, the skill vil adap over time. The skill notise the higest and lowest messured level, and adjust acording to that.


## Credits
Andreas Lorensen
The skill stops adjusting volume if another skill is using the speaker or if Mycroft himself is talking.

The skill can be activated og deactivatet by the command "Hey Mycroft, set auto volume off" or "Hey Mycroft, set auto volume on"


## Examples
* "Set auto volume on"
* "Set auto volume off"

## Credits
Andreas Lorensen (@andlo)

## Supported Devices
platform_mark1 platform_mark2 platform_picroft platform_plasmoid

## Category
Daily
**Configuration**

## Tags
#volume

8 changes: 4 additions & 4 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
import time


class AutoSetVolume(MycroftSkill):
class AutoVolume(MycroftSkill):
def __init__(self):
MycroftSkill.__init__(self)

def initialize(self):
self.filename = os.path.join(get_ipc_directory(), "mic_level")
self.audio_service = AudioService(self.bus)
self.mixer = Mixer()
self.schedule_repeating_event(self.auto_set_volume, None,5, 'AutoSetVolume')
self.schedule_repeating_event(self.mesure_mic_thresh, None,1, 'AutoSetVolume_messure')
self.schedule_repeating_event(self.auto_set_volume, None,5, 'AutoVolume')
self.schedule_repeating_event(self.mesure_mic_thresh, None,1, 'AutoVolume_messure')

self.autovolume = True
if self.settings.get('High volume') == None:
Expand Down Expand Up @@ -119,5 +119,5 @@ def auto_set_volume(self, message):
self.log.info("Setting volume to :" + str(volume) + "%")

def create_skill():
return AutoSetVolume()
return AutoVolume()

4 changes: 2 additions & 2 deletions dialog/en-us/activate.dialog
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
OK
Auto set volume activated
I have activated auto set volume
Auto volume activated
I have activated auto volume
4 changes: 2 additions & 2 deletions dialog/en-us/deactivate.dialog
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
OK
Auto set volume is deactivated
I have now deactivated auto set volume
Auto volume is deactivated
I have now deactivated auto volume
2 changes: 1 addition & 1 deletion settingsmeta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Auto set volume",
"name": "Auto volume",
"skillMetadata": {
"sections": [
{
Expand Down
8 changes: 4 additions & 4 deletions vocab/en-us/activate.intent
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Activate auto (set) volume
Set auto (set) volume Activate
Turn on auto (set) volume
Set auto (set) volume (to) on
Activate auto volume
Set auto volume active
Turn on auto volume
Set auto volume (to) on
8 changes: 4 additions & 4 deletions vocab/en-us/deactivate.intent
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Dectivate auto (set) volume
Set auto (set) volume deactive
Turn off auto (set) volume
Set auto (set) volume (to) off
Dectivate auto volume
Set auto volume deactive
Turn off auto volume
Set auto volume (to) off

0 comments on commit 435246a

Please sign in to comment.