Code Monkey home page Code Monkey logo

news-speaker's Introduction

About

This LaunchAgent uses native macOS speech synthetiser to either read random news article title from RSS feed or just reads a text supplied using HTTP GET request.

Installation

You need to have Xcode IDE installed on your mac. Just type sudo make install. Installation directory is Applications/Speaker. Installation Makefile uses sudo. After the installation, agent is automatically loaded. For uninstallation, just type sudo make uninstall. Root privileges for make are needed to write plist into /Library/LaunchAgents (deploy agent).

Using the speaker

You can communicate with the app using HTTP API. Default address is http://localhost:8080/.

Description of the API:

GET requests:
  /say/{text}           - Read given text. Words are separated by "-".
  /read-rss             - Read random article title from set RSS feed.
  /set                  - Change configuration of the speaker.
                           Usage example: /set?voice=jorge, /set?volume=0.8&rate=170
    ?voice={voice-name} - Speaker voice (see /voices for all available options)
    ?rate={rate}        - The synthesizer's speaking rate (words per minute) expressed in floating-point unit.
                           Average human speech occurs at a rate of 180 to 220 words per minute.
    ?volume={volume}    - The synthesizer's speaking volume is expressed in floating-point unit ranging from 0.0 through 1.0.
  /voices               - Show all available voices
  /restart              - Shutdown and restart the daemon
  /help                 - Show this page
  
POST requests:
  /say                  - Read given text in POST body, using the content-type application/x-www-form-urlencoded.
                           Usage example: curl -d "This is test."  http://localhost:8080/say

Settings

You can pass a path to the plist with the application settings as a command line argument. If no arguments are passed, application uses default settings stored in /Applications/Speaker/defaultSettings.plist. Valid keys and values are:

RSS     [String]  - URL adress of the RSS feed
Rate    [Number]  - The synthesizer's speaking rate (words per minute) expressed in floating-point unit.
Volume  [Number]  - The synthesizer's speaking volume is expressed in floating-point unit ranging from 0.0 through 1.0.
Voice   [String]  - Full name of the sysnthetizer's voice
Jingles [Boolean] - If true, jingles are used also for /say
Port    [Number]  - Port for the server

Notes

In case of any error, user is informed either by HTML content or directly by synthetizer and in log.

Used libraries

BiAtoms/Http.swift

A tiny HTTP server engine written in swift. See Http.swift

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.