Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
latoilescoute-dev
mumble-web
Commits
9ad548e1
Commit
9ad548e1
authored
Sep 19, 2017
by
Jonas Herzig
Browse files
Show own talking state in UI
parent
fd4f2ecc
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/index.js
View file @
9ad548e1
...
...
@@ -301,6 +301,10 @@ class GlobalBindings {
if
(
!
this
.
client
)
{
return
}
if
(
voiceHandler
)
{
voiceHandler
.
end
()
voiceHandler
=
null
}
let
mode
=
this
.
settings
.
voiceMode
if
(
mode
===
'
cont
'
)
{
voiceHandler
=
new
ContinuousVoiceHandler
(
this
.
client
)
...
...
@@ -310,7 +314,18 @@ class GlobalBindings {
}
else
{
log
(
'
Unknown voice mode:
'
,
mode
)
return
}
voiceHandler
.
on
(
'
started_talking
'
,
()
=>
{
if
(
this
.
thisUser
())
{
this
.
thisUser
().
talking
(
'
on
'
)
}
})
voiceHandler
.
on
(
'
stopped_talking
'
,
()
=>
{
if
(
this
.
thisUser
())
{
this
.
thisUser
().
talking
(
'
off
'
)
}
})
}
this
.
messageBoxHint
=
ko
.
pureComputed
(()
=>
{
...
...
@@ -525,6 +540,9 @@ var voiceHandler
initVoice
(
data
=>
{
if
(
!
ui
.
client
)
{
if
(
voiceHandler
)
{
voiceHandler
.
end
()
}
voiceHandler
=
null
}
else
if
(
voiceHandler
)
{
voiceHandler
.
write
(
new
Float32Array
(
data
.
buffer
,
data
.
byteOffset
,
data
.
byteLength
/
4
))
...
...
app/voice.js
View file @
9ad548e1
...
...
@@ -15,9 +15,23 @@ class VoiceHandler extends Writable {
_getOrCreateOutbound
()
{
if
(
!
this
.
_outbound
)
{
this
.
_outbound
=
this
.
_client
.
createVoiceStream
()
this
.
emit
(
'
started_talking
'
)
}
return
this
.
_outbound
}
_stopOutbound
()
{
if
(
this
.
_outbound
)
{
this
.
emit
(
'
stopped_talking
'
)
this
.
_outbound
.
end
()
this
.
_outbound
=
null
}
}
_final
(
callback
)
{
this
.
_stopOutbound
()
callback
()
}
}
export
class
ContinuousVoiceHandler
extends
VoiceHandler
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment