Speech in the space: Difference between revisions

From NURDspace
m (Text replacement - "ProjectPurpose=" to "Purpose=")
 
(8 intermediate revisions by 5 users not shown)
Line 2: Line 2:
|Name=Speech in the space
|Name=Speech in the space
|Skills=Coding,
|Skills=Coding,
|Status=Active
|Status=Production
|ProjectNiche=Software
|Niche=Software
|Purpose=Fun
|Purpose=Fun
|Picture=Speech.gif
|Picture=Speech.gif
|Tool=No
|Tool=No
|Location=
|Location=
|Cost=
|Category=
|Category=
}}
}}
This page is documentation on the 'let's annoy the space vocally' project.
This page is documentation on the 'let's annoy the space vocally' project.
== TLDR ==
We run espeak-server on slabpi directly, it gets mixed with pulseaudio through the MPD output, nothing gets paused so you can sing along with songs :)
NURDbot sends UDP? messages to some port on slabpi directly , incl all voiceparameters.
You need SPEAK or SPACE rights, ask on irc :P
* https://git.nurd.space/g-j-s-dawes/espeak-server


== History ==
== History ==


buZz coded a small text-2-speech irc bot. was on http://pastebin.com/3kj2BJ5U. Flok then rm -rf /* all files with it. After this it was decided it was a  bad idea for now (or at least nobody picked it up). Months later Tall0ak wrote a plugin for jsonbot (aka NURDbot) in python. This set-up was broken when we moved to the current location. The_Niz wrote a new plugin for [[Nurdbot]] which connects to [[Slab]] (used to be [[Robinson]]). This is currently active.
buZz coded a small text-2-speech irc bot. was on http://pastebin.com/3kj2BJ5U. Flok then rm -rf /* all files with it. After this it was decided it was a  bad idea for now (or at least nobody picked it up). Months later Tall0ak wrote a plugin for jsonbot (aka NURDbot) in python. This set-up was broken when we moved to the current location. The_Niz wrote a new plugin for [[Nurdbot]] which connects to [[Slab]] and [[Smokescreen]]. This is currently active.
 
A new service has been written around espeak - https://git.nurd.space/g-j-s-dawes/espeak-server . This service listens on port 16016 for strings and, if present, interprets tab-separated constants as speech variables. It is fed from nurdbot via [[vinculum]], so that a single message can be split across multiple receivers. The code for nurdbot is in the git repo.
 
This service is started via init.d, service espeak-server. The code is in the git repo.
 
Additionally, vinculum forwards the strings and users to the bigledpanel for display in the space.


== Available commands ==
== Available commands ==


* !speak <text>  
* !speak <text>  
This command outputs <text> as speech in the space.
This command outputs <text> as speech in the space via <s>festival</s> espeak.
 
* !espeak <text>
This command outputs <text> as speech in the space via espeak.


* !spreek <text>
This command outputs <text> as speech in the space via espeak with a Dutch accent.
* !sprech <text>
This command outputs <text> as speech in the space via espeak with a German accent.
* !dire <text>
This command outputs <text> as speech in the space via espeak with a French accent.
* !espeak-settings <text>
By default each new IRC user gets a randomly assigned voice. This command allows you to configure these settings. Execute it without parameters to know what your config is.


== Hark hark hark hark ==
== Hark hark hark hark ==


  !speak ick hab here un brief for min moodar
  !espreek ick hab here un brief for min moodar
  !speak dee hoog in the himmel is  
  !espreek dee hoog in the himmel is  
  !speak dee zeh brief binned ick fast oop min fliger
  !speak dee zeh brief binned ick fast oop min fliger
  !speak mar fuck then mar up, mit je zalm
  !speak mar fuck then mar up, mit je zalm
Line 39: Line 69:
  !speak rootjay pohfre ay sjahmn tahmn
  !speak rootjay pohfre ay sjahmn tahmn
  !speak weir hahben S neeght kuh woost?
  !speak weir hahben S neeght kuh woost?
== nodejs quickfix ==
<pre>
var espeak = require('espeak');
var fs = require('fs')
var Sound = require('aplay');
// de+m1 160 0 100 50 username test
// [
//  'de+m1',
//  '160',
//  '0',
//  '100',
//  '50',
//  'nooitaf',
//  'test\n'
// ]
var net = require('net');
var server = net.createServer(function(socket) {
  socket.on('data', function(data) {
    var d = data.toString().split('\t')
    var opt1 = '-v ' + d[0].split('+')[0]
    var opt2 = '-g ' + d[1]
    var opt3 = '-k ' + d[2]
    var opt4 = '-s ' + d[3]
    var opt5 = '-a 100'
    espeak.speak(d[6], [opt5], function(err, wav) {
      if (err) console.log(err)
      fs.writeFile("./speak.wav", wav.buffer, function(err) {
        if (err) console.log(err)
        new Sound().play('./speak.wav');
      })
    });
  });
});
server.listen(16016, '0.0.0.0');
</pre>

Latest revision as of 22:31, 28 August 2019

Speech in the space
Speech.gif
Participants User:buzz, Dennis
Skills Coding
Status Production
Niche Software
Purpose Fun
Tool No
Location
Cost
Tool category

Speech in the space

Speech.gif {{#if:No | [[Tool Owner::{{{ProjectParticipants}}} | }} {{#if:No | [[Tool Cost:: | }}

This page is documentation on the 'let's annoy the space vocally' project.

TLDR

We run espeak-server on slabpi directly, it gets mixed with pulseaudio through the MPD output, nothing gets paused so you can sing along with songs :) NURDbot sends UDP? messages to some port on slabpi directly , incl all voiceparameters.

You need SPEAK or SPACE rights, ask on irc :P

History

buZz coded a small text-2-speech irc bot. was on http://pastebin.com/3kj2BJ5U. Flok then rm -rf /* all files with it. After this it was decided it was a bad idea for now (or at least nobody picked it up). Months later Tall0ak wrote a plugin for jsonbot (aka NURDbot) in python. This set-up was broken when we moved to the current location. The_Niz wrote a new plugin for Nurdbot which connects to Slab and Smokescreen. This is currently active.

A new service has been written around espeak - https://git.nurd.space/g-j-s-dawes/espeak-server . This service listens on port 16016 for strings and, if present, interprets tab-separated constants as speech variables. It is fed from nurdbot via vinculum, so that a single message can be split across multiple receivers. The code for nurdbot is in the git repo.

This service is started via init.d, service espeak-server. The code is in the git repo.

Additionally, vinculum forwards the strings and users to the bigledpanel for display in the space.

Available commands

  • !speak <text>

This command outputs <text> as speech in the space via festival espeak.

  • !espeak <text>

This command outputs <text> as speech in the space via espeak.

  • !spreek <text>

This command outputs <text> as speech in the space via espeak with a Dutch accent.

  • !sprech <text>

This command outputs <text> as speech in the space via espeak with a German accent.

  • !dire <text>

This command outputs <text> as speech in the space via espeak with a French accent.

  • !espeak-settings <text>

By default each new IRC user gets a randomly assigned voice. This command allows you to configure these settings. Execute it without parameters to know what your config is.

Hark hark hark hark

!espreek ick hab here un brief for min moodar
!espreek dee hoog in the himmel is 
!speak dee zeh brief binned ick fast oop min fliger
!speak mar fuck then mar up, mit je zalm
!speak noik yow ick do need what yaj maaj sekt
!speak HOORAAA
!speak yah rhine stah pahnahcook are eye, zack ick yah
!speak domini keh ni keh ni keh
!speak sahn ahllait toot simpelemahmn
!speak rootjay pohfre ay sjahmn tahmn
!speak weir hahben S neeght kuh woost?


nodejs quickfix

var espeak = require('espeak');
var fs = require('fs')
var Sound = require('aplay');

// de+m1	160	0	100	50	username	test
// [
//   'de+m1',
//   '160',
//   '0',
//   '100',
//   '50',
//   'nooitaf',
//   'test\n'
// ]

var net = require('net');

var server = net.createServer(function(socket) {
  socket.on('data', function(data) {
    var d = data.toString().split('\t')
    var opt1 = '-v ' + d[0].split('+')[0]
    var opt2 = '-g ' + d[1]
    var opt3 = '-k ' + d[2]
    var opt4 = '-s ' + d[3]
    var opt5 = '-a 100'
    espeak.speak(d[6], [opt5], function(err, wav) {
      if (err) console.log(err)
      fs.writeFile("./speak.wav", wav.buffer, function(err) {
        if (err) console.log(err)
        new Sound().play('./speak.wav');
      })
    });
  });
});

server.listen(16016, '0.0.0.0');