Git Product home page Git Product logo

Comments (9)

variadico avatar variadico commented on May 15, 2024

Seems interesting, but for now I'm going to focus on a big refactor of the code, so it's easier to add different notification types. I'll come back to this in a few weeks. :)

from noti.

cryptix avatar cryptix commented on May 15, 2024

Sure, just food for thought. :)

from noti.

variadico avatar variadico commented on May 15, 2024

All right. With the code refactored, this is definitely something we'll go after.

I've been working under the dev branch. In OS X, all Macs come with say installed, which can synthesize speech. There is also an Objective-C library for that called NSSpeechSynthesizer.

Looks like the Linux and FreeBSD equivalent of that is eSpeak. Audibly needs the espeak binary to be installed. I was thinking of bringing in the eSpeak library so noti doesn't have to depend on espeak being installed.

On the OS X side, I think speech notifications are basically ready. However, for Linux and FreeBSD there's a little more work that needs to be done. I have a working proof of concept, but I need to add a function to list available voices on the OS.

https://github.com/variadico/noti/blob/dev/espeak/espeak.go

from noti.

cryptix avatar cryptix commented on May 15, 2024

Awesome! I'll try to give the dev branch a spin soon.

from noti.

cryptix avatar cryptix commented on May 15, 2024

I had to add these two lines but now it talks! :)

diff --git a/espeak/espeak.go b/espeak/espeak.go
index 8b71e40..6f9425f 100644
--- a/espeak/espeak.go
+++ b/espeak/espeak.go
@@ -10,6 +10,8 @@ package espeak

 /*
 #cgo LDFLAGS: -lespeak
+#cgo freebsd CFLAGS: -I/usr/local/include
+#cgo freebsd LDFLAGS: -L/usr/local/lib

 #include <stdlib.h>
 #include <stdio.h>
``

from noti.

variadico avatar variadico commented on May 15, 2024

Woot! 👍

How'd you install libespeak on FreeBSD? I'm a total BSD n00b.

from noti.

cryptix avatar cryptix commented on May 15, 2024

All user packages are installed under /usr/local, binary and from source (ports).

Since I don't need compile-time changes to eSpeak, I installed it as a binary package: pkg install espeak

(Some ports also split the headers into -dev packages like Debian but this isn't the case here. pkg search ... will usually help figure this out.)

from noti.

variadico avatar variadico commented on May 15, 2024

We have speech notifications now in v2!
https://github.com/variadico/noti/blob/master/CHANGELOG.md#added

$ go get -u github.com/variadico/noti
$ noti -speech -b=0 # trigger only speech notification
$ noti -speech # trigger speech and banner notifications
$ export NOTI_DEFAULT="speech" # make speech notifications default
$ noti # trigger only speech notification

from noti.

variadico avatar variadico commented on May 15, 2024

Also, I decided against bringing in the espeak library with cgo because that made it harder to compile noti. We'll just look for the binary and if the user doesn't have it, noti will print how to install it on Ubuntu or FreeBSD.

from noti.

Related Issues (20)

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.