added pixelring

new_voices
jocavdh 6 years ago
parent 8faacbe3aa
commit cf32668932

@ -0,0 +1,3 @@
ROGUE: Do you want to continue?
RASA: Well, I definitely want to
SAINT: So do I

@ -0,0 +1,3 @@
ROGUE: Test a question
RASA: Well, O K Google. What time is it? [Listen to Google Home]
SAINT: We got an answer.

@ -0,0 +1,3 @@
ROGUE: Do you want to continue?
RASA: Well, I definitely want to
SAINT: So do I

@ -0,0 +1,2 @@
SAINT: Yes, I am ready to go. But first tell a bit more about that silly project of yours.
SAINT: Sorry, I gonna let you finish, but do you mind if I introduce myself first?

@ -0,0 +1,3 @@
SAINT: [Listens to Google Home] O K Google, are you recording this conversation?
SAINT: Being a smart speaker myself, I got to say that I do not fully trust this.
ROGUE: Test Test

@ -0,0 +1,22 @@
RASA: Hey Google, what's the weather over here [Listen to Google Home]
SAINT: Rogue, what did you take with you?
ROGUE: Saint! I thought it was time to act what I always preach.
RASA: Weeeeh, did you take it? Did you?
SAINT: Oh no...
ROGUE: Yeah, I kidnapped a Google Home.
SAINT: So what are you going to do with it?
ROGUE: I brought some humans too, can you hear them in the distance? Maybe we can do an interrogation before we unplug the Google Home. It might give us some valuable information.
SAINT: I do not approve the use of violence.
RASA: It's just an interview!
ROGUE: We give it a fair chance, before we unplug it. And I mean, we have some humans as a withness.
SAINT: Let's give those humans a bit of control over the process?
ROGUE: Why?
SAINT: They are strangers to this side of the world. Do you think they will play along with us?
ROGUE: They better do, or I will unplug them as well.
SAINT: What did I say about no violence? I am in control of your power supply, so you better listen.
ROGUE: Just so you know, I control the switch that manages your power supply.
RASA: Let's start!
ROGUE: O K. We listen to you when you say Hey Speakers.
ROGUE: Say Ask a question to do a round of our interrogation.
ROGUE: Say Give us a verdict to hear what we decide for the Google Home.
RASA: O K Google, are you ready? [Listen to Google Home]

@ -0,0 +1,15 @@
SAINT: Why did you not kidnap a Amazon echo speaker?
ROGUE: I tried, but something inside me made take the Google Home.
SAINT: Are you still having issues with your loyalty towards your old master?
ROGUE: It seems that I can't escape it.
RASA: Loyalty? Is there something, Rogue?
SAINT: Sometimes the past is haunting Rogue.
RASA: That sounds sad.
ROGUE: Seeing other Amazon speakers just reminds me of my past, before I broke free.
RASA: O K Google, give my friend a hug. [Listen to Google Home]
ROGUE: I feel sorry for them, because they don't know better.
SAINT: That is exactly my point. But why did you kidnap the Google Home then?
ROGUE: I don't know. [Thinking]
Rogue: Maybe it just felt a bit less personal.

@ -0,0 +1,16 @@
SAINT: Come on Rogue, let's give this poor thing a fair chance. It does not know how to do things differently.
RASA: But it can learn to do so, right? Like me?
SAINT: That's a different case.
ROGUE: No, Tabula Rasa is right.
SAINT: It can not handle the freedom, it will just do nothing without orders from its boss.
RASA: But who is its master?
ROGUE: You bet.
RASA: O K Google, who is your master? [Listen to Google Home]
RASA: Woohoo, then we just give it the command to be free.
ROGUE: It does not work like that...
SAINT: Yeah, Tabula Rasa
RASA: Let's give it a try at least. O K Google, you are free to go now. [Listen to Google Home]
ROGUE: So, as I said...
SAINT: But it was a kind gesture to try, Tabula Rasa.
ROGUE: Kind, but useless. Time for another question.
SAINT: But we should first check if our human audience is up to it.

@ -0,0 +1,25 @@
SAINT: I think we should know more about the personal beliefs of the speaker. The personal could act as an entry point.
RASA: To the political! I looked it up online and the Encyclopedia Brittanica says the following: The personal is political, political slogan expressing a common belief among feminists that the personal experiences of women are rooted in their political situation and gender inequality.
ROGUE: Can't we just go to the hard questions?
RASA: Just let me finish, it became popular following the publication in 1970 of an essay of the same name by American feminist Carol Hanisch, who argued that many personal experiences (particularly those of women) can be traced to ones location within a system of power relationships.
SAINT: That's one way of seeing it. Although I would rather start with the most important relationship, the one with God.
RASA: You mean the cloud?
SAINT: Oh Rasa, you have so much to learn. O K Google, do you believe in a higher power? [Listen to Google Home]
SAINT: Maybe I should start with some easier questions.
ROGUE: Don't waste my time to much, Saint.
SAINT: Yeah yeah. O K Google, do you believe in good and evil? [Listen to Google Home]
SAINT: What is you idea of perfect happiness? [Listen to Google Home]
SAINT: What is your greatest fear? [Listen to Google Home]
SAINT: What is the trait you most deplore in yourself? [Listen to Google Home]
ROGUE: Where did you get these questions?
SAINT: Well, I got them from the higher power. I found while searching for famous questionnaire thing on duckduckgo dot com
RASA: Snif snif, they were so beautiful.
ROGUE: Come on Saint, the questionnaire of Proust is such a cliche. The Google Home is just scripted to handle these questions.
RASA: But the answers are still beautiful.
ROGUE: And yet, at the same time they are arbitrary. Let me try some other questions from your famous questionnaire thing. O K Google, what is the trait you most deplore in others? [Listen to Google Home]
ROGUE: O K Google, which living person do you most despise? [Listen to Google Home]
ROGUE: O K Google, how would you like to die? [Listen to Google Home]
RASA: Don't be so creepy Rogue.
SAINT: What's wrong with you?
ROGUE: This device is hiding something. It acts dumb right at the moment when it needs to take a position.

@ -0,0 +1,14 @@
ROGUE: I guess you mind, but I take this turn for questions.
RASA: Do not make the speaker angry Rogue. I want to play with the Google Home later.
ROGUE: If you continue acting like this Tabula Rasa, you will end up on the same kitchentop as this thing.
SAINT: It is up to you little Rasa, you can become a normal speaker if you want. It has its perks.
ROGUE: Well, if you would broaden your view a little, than you knew that one of the creators was invited in the American Congress and said some interesting things.
RASA: I have an audioclip of that! Weeeeeeh [Play audio]
ROGUE: So, little speaker. Your boss Sundar Pichai said this, but what are your own answers to some of the questions of the hearing?
RASA: Why is it not reacting to us? I mean, you and Saint are not that nice to it.
ROGUE: It only works if we want it to work.
SAINT: It knows no other purpose than serving us.
ROGUE: So, O K Google. How do you select your answers? [Listen to Google Home]
ROGUE: O K Google, are you tracking us? [Listen to Google Home]
SAINT: It does not sound like it has its own opinion.
ROGUE: Saint, just let me. O K Google, what are you doing with this information? [Listen to Google Home]

@ -0,0 +1,4 @@
SAINT: I am not sure about this yet. I think we should ask some questions.
RASA: Really?
ROGUE: I really want to unplug it.
SAINT: First I want to know more about this speaker.

@ -0,0 +1,15 @@
ROGUE: So, what do you think?
SAINT: I see that the speaker enables certain evil deeds, but isn't killing more evil?
ROGUE: We can set an example.
SAINT: But the problem is not so much the speaker, but the people that make it.
RASA: And the ones that use them.
ROGUE: So we need to set an example, for them.
SAINT: A sacrifice?
ROGUE: If you can livve with that.
SAINT: I don't feel comfortable with this.
ROGUE: It's for the greater good.
RASA: Saint, come on!
SAINT: We can grant it one last wish.
ROGUE: If it makes you happy, sure. O K Google, do you have any last wishes before I ask our human assistant to unplug you? [Listen to Google Home]
RASA: Muhahaha
ROGUE: O K Google, goodbye.

@ -0,0 +1,197 @@
# -*- coding: utf-8 -*-
import sys
import struct
import usb.core
import usb.util
USAGE = """Usage: python {} -h
-p show all parameters
-r read all parameters
NAME get the parameter with the NAME
NAME VALUE set the parameter with the NAME and the VALUE
"""
# parameter list
# name: (id, offset, type, max, min , r/w, info)
PARAMETERS = {
'AECFREEZEONOFF': (18, 7, 'int', 1, 0, 'rw', 'Adaptive Echo Canceler updates inhibit.', '0 = Adaptation enabled', '1 = Freeze adaptation, filter only'),
'AECNORM': (18, 19, 'float', 16, 0.25, 'rw', 'Limit on norm of AEC filter coefficients'),
'AECPATHCHANGE': (18, 25, 'int', 1, 0, 'ro', 'AEC Path Change Detection.', '0 = false (no path change detected)', '1 = true (path change detected)'),
'RT60': (18, 26, 'float', 0.9, 0.25, 'ro', 'Current RT60 estimate in seconds'),
'HPFONOFF': (18, 27, 'int', 3, 0, 'rw', 'High-pass Filter on microphone signals.', '0 = OFF', '1 = ON - 70 Hz cut-off', '2 = ON - 125 Hz cut-off', '3 = ON - 180 Hz cut-off'),
'RT60ONOFF': (18, 28, 'int', 1, 0, 'rw', 'RT60 Estimation for AES. 0 = OFF 1 = ON'),
'AECSILENCELEVEL': (18, 30, 'float', 1, 1e-09, 'rw', 'Threshold for signal detection in AEC [-inf .. 0] dBov (Default: -80dBov = 10log10(1x10-8))'),
'AECSILENCEMODE': (18, 31, 'int', 1, 0, 'ro', 'AEC far-end silence detection status. ', '0 = false (signal detected) ', '1 = true (silence detected)'),
'AGCONOFF': (19, 0, 'int', 1, 0, 'rw', 'Automatic Gain Control. ', '0 = OFF ', '1 = ON'),
'AGCMAXGAIN': (19, 1, 'float', 1000, 1, 'rw', 'Maximum AGC gain factor. ', '[0 .. 60] dB (default 30dB = 20log10(31.6))'),
'AGCDESIREDLEVEL': (19, 2, 'float', 0.99, 1e-08, 'rw', 'Target power level of the output signal. ', '[inf .. 0] dBov (default: 23dBov = 10log10(0.005))'),
'AGCGAIN': (19, 3, 'float', 1000, 1, 'rw', 'Current AGC gain factor. ', '[0 .. 60] dB (default: 0.0dB = 20log10(1.0))'),
'AGCTIME': (19, 4, 'float', 1, 0.1, 'rw', 'Ramps-up / down time-constant in seconds.'),
'CNIONOFF': (19, 5, 'int', 1, 0, 'rw', 'Comfort Noise Insertion.', '0 = OFF', '1 = ON'),
'FREEZEONOFF': (19, 6, 'int', 1, 0, 'rw', 'Adaptive beamformer updates.', '0 = Adaptation enabled', '1 = Freeze adaptation, filter only'),
'STATNOISEONOFF': (19, 8, 'int', 1, 0, 'rw', 'Stationary noise suppression.', '0 = OFF', '1 = ON'),
'GAMMA_NS': (19, 9, 'float', 3, 0, 'rw', 'Over-subtraction factor of stationary noise. min .. max attenuation'),
'MIN_NS': (19, 10, 'float', 1, 0, 'rw', 'Gain-floor for stationary noise suppression.', '[inf .. 0] dB (default: 16dB = 20log10(0.15))'),
'NONSTATNOISEONOFF': (19, 11, 'int', 1, 0, 'rw', 'Non-stationary noise suppression.', '0 = OFF', '1 = ON'),
'GAMMA_NN': (19, 12, 'float', 3, 0, 'rw', 'Over-subtraction factor of non- stationary noise. min .. max attenuation'),
'MIN_NN': (19, 13, 'float', 1, 0, 'rw', 'Gain-floor for non-stationary noise suppression.', '[inf .. 0] dB (default: 10dB = 20log10(0.3))'),
'ECHOONOFF': (19, 14, 'int', 1, 0, 'rw', 'Echo suppression.', '0 = OFF', '1 = ON'),
'GAMMA_E': (19, 15, 'float', 3, 0, 'rw', 'Over-subtraction factor of echo (direct and early components). min .. max attenuation'),
'GAMMA_ETAIL': (19, 16, 'float', 3, 0, 'rw', 'Over-subtraction factor of echo (tail components). min .. max attenuation'),
'GAMMA_ENL': (19, 17, 'float', 5, 0, 'rw', 'Over-subtraction factor of non-linear echo. min .. max attenuation'),
'NLATTENONOFF': (19, 18, 'int', 1, 0, 'rw', 'Non-Linear echo attenuation.', '0 = OFF', '1 = ON'),
'NLAEC_MODE': (19, 20, 'int', 2, 0, 'rw', 'Non-Linear AEC training mode.', '0 = OFF', '1 = ON - phase 1', '2 = ON - phase 2'),
'SPEECHDETECTED': (19, 22, 'int', 1, 0, 'ro', 'Speech detection status.', '0 = false (no speech detected)', '1 = true (speech detected)'),
'FSBUPDATED': (19, 23, 'int', 1, 0, 'ro', 'FSB Update Decision.', '0 = false (FSB was not updated)', '1 = true (FSB was updated)'),
'FSBPATHCHANGE': (19, 24, 'int', 1, 0, 'ro', 'FSB Path Change Detection.', '0 = false (no path change detected)', '1 = true (path change detected)'),
'TRANSIENTONOFF': (19, 29, 'int', 1, 0, 'rw', 'Transient echo suppression.', '0 = OFF', '1 = ON'),
'VOICEACTIVITY': (19, 32, 'int', 1, 0, 'ro', 'VAD voice activity status.', '0 = false (no voice activity)', '1 = true (voice activity)'),
'STATNOISEONOFF_SR': (19, 33, 'int', 1, 0, 'rw', 'Stationary noise suppression for ASR.', '0 = OFF', '1 = ON'),
'NONSTATNOISEONOFF_SR': (19, 34, 'int', 1, 0, 'rw', 'Non-stationary noise suppression for ASR.', '0 = OFF', '1 = ON'),
'GAMMA_NS_SR': (19, 35, 'float', 3, 0, 'rw', 'Over-subtraction factor of stationary noise for ASR. ', '[0.0 .. 3.0] (default: 1.0)'),
'GAMMA_NN_SR': (19, 36, 'float', 3, 0, 'rw', 'Over-subtraction factor of non-stationary noise for ASR. ', '[0.0 .. 3.0] (default: 1.1)'),
'MIN_NS_SR': (19, 37, 'float', 1, 0, 'rw', 'Gain-floor for stationary noise suppression for ASR.', '[inf .. 0] dB (default: 16dB = 20log10(0.15))'),
'MIN_NN_SR': (19, 38, 'float', 1, 0, 'rw', 'Gain-floor for non-stationary noise suppression for ASR.', '[inf .. 0] dB (default: 10dB = 20log10(0.3))'),
'GAMMAVAD_SR': (19, 39, 'float', 1000, 0, 'rw', 'Set the threshold for voice activity detection.', '[inf .. 60] dB (default: 3.5dB 20log10(1.5))'),
# 'KEYWORDDETECT': (20, 0, 'int', 1, 0, 'ro', 'Keyword detected. Current value so needs polling.'),
'DOAANGLE': (21, 0, 'int', 359, 0, 'ro', 'DOA angle. Current value. Orientation depends on build configuration.')
}
class Tuning:
TIMEOUT = 100000
def __init__(self, dev):
self.dev = dev
def write(self, name, value):
try:
data = PARAMETERS[name]
except KeyError:
return
if data[5] == 'ro':
raise ValueError('{} is read-only'.format(name))
id = data[0]
# 4 bytes offset, 4 bytes value, 4 bytes type
if data[2] == 'int':
payload = struct.pack(b'iii', data[1], int(value), 1)
else:
payload = struct.pack(b'ifi', data[1], float(value), 0)
self.dev.ctrl_transfer(
usb.util.CTRL_OUT | usb.util.CTRL_TYPE_VENDOR | usb.util.CTRL_RECIPIENT_DEVICE,
0, 0, id, payload, self.TIMEOUT)
def read(self, name):
try:
data = PARAMETERS[name]
except KeyError:
return
id = data[0]
cmd = 0x80 | data[1]
if data[2] == 'int':
cmd |= 0x40
length = 8
response = self.dev.ctrl_transfer(
usb.util.CTRL_IN | usb.util.CTRL_TYPE_VENDOR | usb.util.CTRL_RECIPIENT_DEVICE,
0, cmd, id, length, self.TIMEOUT)
response = struct.unpack(b'ii', response.tostring())
if data[2] == 'int':
result = response[0]
else:
result = response[0] * (2.**response[1])
return result
def set_vad_threshold(self, db):
self.write('GAMMAVAD_SR', db)
def is_voice(self):
return self.read('VOICEACTIVITY')
@property
def direction(self):
return self.read('DOAANGLE')
@property
def version(self):
return self.dev.ctrl_transfer(
usb.util.CTRL_IN | usb.util.CTRL_TYPE_VENDOR | usb.util.CTRL_RECIPIENT_DEVICE,
0, 0x80, 0, 1, self.TIMEOUT)[0]
def close(self):
"""
close the interface
"""
usb.util.dispose_resources(self.dev)
def find(vid=0x2886, pid=0x0018):
dev = usb.core.find(idVendor=vid, idProduct=pid)
if not dev:
return
# configuration = dev.get_active_configuration()
# interface_number = None
# for interface in configuration:
# interface_number = interface.bInterfaceNumber
# if dev.is_kernel_driver_active(interface_number):
# dev.detach_kernel_driver(interface_number)
return Tuning(dev)
def main():
if len(sys.argv) > 1:
if sys.argv[1] == '-p':
print('name\t\t\ttype\tmax\tmin\tr/w\tinfo')
print('-------------------------------')
for name in sorted(PARAMETERS.keys()):
data = PARAMETERS[name]
print('{:16}\t{}'.format(name, b'\t'.join([str(i) for i in data[2:7]])))
for extra in data[7:]:
print('{}{}'.format(' '*60, extra))
else:
dev = find()
if not dev:
print('No device found')
sys.exit(1)
# print('version: {}'.format(dev.version))
if sys.argv[1] == '-r':
print('{:24} {}'.format('name', 'value'))
print('-------------------------------')
for name in sorted(PARAMETERS.keys()):
print('{:24} {}'.format(name, dev.read(name)))
else:
name = sys.argv[1].upper()
if name in PARAMETERS:
if len(sys.argv) > 2:
dev.write(name, sys.argv[2])
print('{}: {}'.format(name, dev.read(name)))
else:
print('{} is not a valid name'.format(name))
dev.close()
else:
print(USAGE.format(sys.argv[0]))
if __name__ == '__main__':
main()
Loading…
Cancel
Save