character to speech
This commit is contained in:
parent
ccfa6f9575
commit
147c67962c
1 changed files with 44 additions and 0 deletions
|
@ -1,4 +1,6 @@
|
||||||
using System.Security.AccessControl;
|
using System.Security.AccessControl;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Main;
|
namespace Main;
|
||||||
public class Mono
|
public class Mono
|
||||||
|
@ -256,6 +258,8 @@ public class Mono
|
||||||
txt += keb_keys[i].char_;
|
txt += keb_keys[i].char_;
|
||||||
monoNet.value = keb_keys[i].char_;
|
monoNet.value = keb_keys[i].char_;
|
||||||
monoNet.send = true;
|
monoNet.send = true;
|
||||||
|
|
||||||
|
CTS(keb_keys[i].char_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,6 +289,8 @@ public class Mono
|
||||||
{
|
{
|
||||||
// send haptic input for input confirmation
|
// send haptic input for input confirmation
|
||||||
txt += KeyToChar(index_i);
|
txt += KeyToChar(index_i);
|
||||||
|
|
||||||
|
CTS(KeyToChar(index_i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -423,4 +429,42 @@ public class Mono
|
||||||
public Key key;
|
public Key key;
|
||||||
public char char_;
|
public char char_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Dictionary<char, Sound> sfx_alpha = new()
|
||||||
|
{
|
||||||
|
['a'] = Sound.FromFile("alpha/a.mp3"),
|
||||||
|
['b'] = Sound.FromFile("alpha/b.mp3"),
|
||||||
|
['c'] = Sound.FromFile("alpha/c.mp3"),
|
||||||
|
['d'] = Sound.FromFile("alpha/d.mp3"),
|
||||||
|
['e'] = Sound.FromFile("alpha/e.mp3"),
|
||||||
|
['f'] = Sound.FromFile("alpha/f.mp3"),
|
||||||
|
['g'] = Sound.FromFile("alpha/g.mp3"),
|
||||||
|
['h'] = Sound.FromFile("alpha/h.mp3"),
|
||||||
|
['i'] = Sound.FromFile("alpha/i.mp3"),
|
||||||
|
['j'] = Sound.FromFile("alpha/j.mp3"),
|
||||||
|
['k'] = Sound.FromFile("alpha/k.mp3"),
|
||||||
|
['l'] = Sound.FromFile("alpha/l.mp3"),
|
||||||
|
['m'] = Sound.FromFile("alpha/m.mp3"),
|
||||||
|
['n'] = Sound.FromFile("alpha/n.mp3"),
|
||||||
|
['o'] = Sound.FromFile("alpha/o.mp3"),
|
||||||
|
['p'] = Sound.FromFile("alpha/p.mp3"),
|
||||||
|
['q'] = Sound.FromFile("alpha/q.mp3"),
|
||||||
|
['r'] = Sound.FromFile("alpha/r.mp3"),
|
||||||
|
['s'] = Sound.FromFile("alpha/s.mp3"),
|
||||||
|
['t'] = Sound.FromFile("alpha/t.mp3"),
|
||||||
|
['u'] = Sound.FromFile("alpha/u.mp3"),
|
||||||
|
['v'] = Sound.FromFile("alpha/v.mp3"),
|
||||||
|
['w'] = Sound.FromFile("alpha/w.mp3"),
|
||||||
|
['x'] = Sound.FromFile("alpha/x.mp3"),
|
||||||
|
['y'] = Sound.FromFile("alpha/y.mp3"),
|
||||||
|
['z'] = Sound.FromFile("alpha/z.mp3"),
|
||||||
|
};
|
||||||
|
|
||||||
|
// character to speech
|
||||||
|
void CTS(char char_)
|
||||||
|
{
|
||||||
|
if (!sfx_alpha.ContainsKey(char_))
|
||||||
|
return;
|
||||||
|
sfx_alpha[char_].Play(keyboard_m4.Pose.position);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue