Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PAnTHer
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
puma
client
PAnTHer
Commits
ac751693
Commit
ac751693
authored
7 months ago
by
Lucio Zambon
Browse files
Options
Downloads
Patches
Plain Diff
Update talk.php
parent
f967ae16
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
speech/talk.php
+23
-10
23 additions, 10 deletions
speech/talk.php
with
23 additions
and
10 deletions
speech/talk.php
+
23
−
10
View file @
ac751693
...
...
@@ -108,7 +108,7 @@ CREATE TABLE IF NOT EXISTS ujive (
}
if
(
!
empty
(
$_REQUEST
[
'ctree'
]))
{
dbUpsert
(
'ujive'
,
$_REQUEST
[
'token'
],
$_REQUEST
[
'ctree'
]);
/
* do NOT
wait for a response
/
/
wait for a response
for
(
$i
=
0
;
$i
<
50
;
$i
++
)
{
$f
=
dbRead
(
'ujive'
,
$_REQUEST
[
'token'
]);
if
(
!
empty
(
$f
)
&&
$f
!=
$_REQUEST
[
'ctree'
])
{
...
...
@@ -120,9 +120,11 @@ CREATE TABLE IF NOT EXISTS ujive (
}
dbUpsert
(
'ujive'
,
$_REQUEST
[
'token'
],
''
);
mylog
(
", R: timeout"
);
die("{$_REQUEST['ctree']} not found, timeout");
*/
die
(
'OK'
);
die
(
"
{
$_REQUEST
[
'ctree'
]
}
not responding, timeout"
);
// die('OK');
}
if
(
isset
(
$_REQUEST
[
'ctreeresult'
]))
{
dbUpsert
(
'ujive'
,
$_REQUEST
[
'token'
],
substr
(
$_REQUEST
[
'ctreeresult'
],
0
,
50
));
}
if
(
!
empty
(
$_REQUEST
[
'ujive'
]))
{
set_time_limit
(
0
);
...
...
@@ -288,30 +290,41 @@ CREATE TABLE IF NOT EXISTS ujive (
</head>
<body
onLoad=
'myload()'
style=
"background-color: rgb(0, 0, 0, 0);"
>
<div
id=
'transcriptDiv'
style=
'display:none;'
></div>
<div
style=
"max-width:
28
0px; max-height: 30px; text-align: center;"
>
<div
style=
"max-width:
36
0px; max-height: 30px; text-align: center;"
>
<audio
id=
'speechText'
onended=
'speakagain();'
onerror=
'showLog("audio err: "+event.error)'
></audio>
<span
style=
'color: darkgreen; font-weight: bold;'
id=
'title'
>
Talk to ...
</span>
<img
src=
'./microphone-na.png'
onClick=
'naClick()'
title=
'not available'
id=
'micna'
>
<img
src=
'./microphone-on.png'
onClick=
'stopRec()'
id=
'micstart'
style=
'display: none; padding-right:
6
0px; max-width:
30
0px;'
>
<img
src=
'./microphone-off.png'
onClick=
'startRec()'
id=
'micstop'
style=
'display: none; padding-right:
6
0px;'
>
<img
src=
'./microphone-on.png'
onClick=
'stopRec()'
id=
'micstart'
style=
'display: none; padding-right:
4
0px; max-width:
27
0px;'
>
<img
src=
'./microphone-off.png'
onClick=
'startRec()'
id=
'micstop'
style=
'display: none; padding-right:
4
0px;'
>
<div
style=
'cursor: pointer;padding-right: 5px; text-align: right; margin-top: -1.3em;'
id=
'langselect'
>
<img
style=
"max-height: 18px; margin-right: 10px;"
src=
'./it-IT.png'
onClick=
"switchLocale('it')"
>
<img
style=
"max-height: 18px; margin-right: 10px;"
src=
'./en-US.png'
onClick=
"switchLocale('en')"
>
<span
style=
'color: darkgreen; font-weight: bold;'
onClick=
'commandlistinfo()'
>
?
</span>
</div>
<div
style=
'padding-left: 5px; text-align: left; margin-top: -1.3em;'
id=
'operation'
>
<img
style=
"margin-right: 10px;"
id=
'open'
src=
'./open.png'
>
<img
style=
"margin-right: 10px;"
id=
'search'
src=
'./search.png'
>
<img
style=
"margin-right: 10px;"
id=
'open'
src=
'./open.png'
title=
'open panel'
>
<img
style=
"margin-right: 10px;"
id=
'search'
src=
'./search.png'
title=
'search'
>
<img
style=
"margin-right: 10px;"
id=
'tree'
src=
'./tree.png'
title=
'uJive'
>
<img
style=
"margin-right: 10px; display: none;"
id=
'chart'
src=
'./chart.png'
title=
'chart'
>
</div>
<span
style=
'color: darkblue; font-weight: bold;'
id=
'miclabel'
>
comandi vocali
</span>
<table
id =
'openTable'
class=
"table table-hover"
></table>
<span
id=
'ctree'
></span>
<pre
id=
'log'
></pre>
<script>
function
inIframe
()
{
try
{
return
window
.
self
!==
window
.
top
;
}
catch
(
e
)
{
return
true
;
}
}
// showLog('webkitSpeechRecognition: '+ typeof window.webkitSpeechRecognition);
// showLog('SpeechRecognition: '+ typeof window.SpeechRecognition);
window
.
SpeechRecognition
=
window
.
webkitSpeechRecognition
||
window
.
SpeechRecognition
;
if
(
typeof
window
.
SpeechRecognition
==
'
undefined
'
&&
document
.
location
.
search
.
indexOf
(
'
?d=
'
)
==-
1
)
{
// if (typeof window.SpeechRecognition == 'undefined' && document.location.search.indexOf('?d=')==-1) {
if
(
inIframe
())
{
let
tok
=
document
.
location
.
search
.
indexOf
(
'
token=
'
)
==-
1
?
Math
.
round
(
Math
.
random
()
*
1000000000000
+
1
):
document
.
location
.
search
.
split
(
'
token=
'
)[
1
].
split
(
'
&
'
)[
0
];
if
(
isNaN
(
tok
)
||
tok
<
1000000000
)
tok
=
Math
.
round
(
Math
.
random
()
*
1000000000000
+
1
);
console
.
log
(
'
./qr.php?data=
'
+
tok
+
'
&host=
<?php
echo
$host
;
?>
'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment