def unmute_pc(p, l): """ Restores the previous volume (if any) else just set it to -25 """ m = "PC un-muted" if previous_volume and previous_volume > volume.get_volume_range()[0]: volume.set_volume(previous_volume) respond(m) return volume.set_volume(-25) respond(m)
def mute_pc(p, l): """ Sets the system volume to the minimum """ global previous_volume respond("PC muted", say_wait=True) previous_volume = volume.get_current_volume() volume.set_volume(volume.get_volume_range()[0])
import os import random import feedparser import time import webbrowser from urllib import urlencode import winspeech from utils import configreader from utils import volume from utils.htmlparsers import NewsFeedParser BASE_DIRECTORY = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) VOLUME_RANGE = volume.get_volume_range() MIN_VOLUME = VOLUME_RANGE[0] MAX_VOLUME = VOLUME_RANGE[1] preferences = configreader.get_preferences() title = preferences.get_user_title() previous_volume = None def _get_all_files(directory, extensions): """ Returns a list of all the files from a directory and it's sub-directories with a specific extension Parameters: directory: