Skip to content

Commit

Permalink
help
Browse files Browse the repository at this point in the history
  • Loading branch information
espidev committed Sep 14, 2019
1 parent 2592208 commit ccbb090
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/assets/html/session.html
Expand Up @@ -145,7 +145,7 @@
<p class="center nfont titling">summary <i class="material-icons" style="font-size: 36px; color: black;">track_changes</i></p>
<p class="text-summary nfont" id="meeting-summary">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
<div class="col s7 pull-s5 rolling-trans">
<div class="col s7 pull-s5 rolling-trans" style="overflow-x: hidden; overflow-y: hidden;">

<p class="center nfont titling">chat <i class="material-icons" style="font-size: 36px; color: black;">chat</i></p>

Expand Down Expand Up @@ -193,7 +193,7 @@

let socket = new WebSocket("ws://{{ .rootDomain }}/stream-audio");
socket.onopen = function () {
//socket.send(document.cookie);
socket.send(document.cookie);
};
// this is great everything is great

Expand Down Expand Up @@ -303,14 +303,14 @@
//console.log(time);
document.getElementById("meeting-summary").textContent = httpGet('/live-summary')

}, 2000);
}, 500);

var interval = setInterval(function() {
time2+=2;
//console.log(time2);
document.getElementById("meeting-set").innerHTML = httpGet('/live-chat')

}, 2000);
}, 500);


</script>
Expand Down
5 changes: 3 additions & 2 deletions src/main/main.go
Expand Up @@ -11,6 +11,7 @@ import (
"net/http"
"os"
"os/signal"
"strings"
"time"

speech "cloud.google.com/go/speech/apiv1"
Expand Down Expand Up @@ -244,7 +245,7 @@ func newAudioReceive(w http.ResponseWriter, hr *http.Request) {
log.Println("Error receiving audio: " + err.Error())
return
}
user := string(sr)
user := strings.ReplaceAll(string(sr), "name=", "")
log.Println("Got user cookie: " + user)

go func() {
Expand All @@ -268,7 +269,7 @@ func newAudioReceive(w http.ResponseWriter, hr *http.Request) {

if err := stream.Send(&speechpb.StreamingRecognizeRequest{
StreamingRequest: &speechpb.StreamingRecognizeRequest_AudioContent{
AudioContent: buf[:], // TODO
AudioContent: buf,
},
}); err != nil {
log.Printf("Could not send audio: %v", err)
Expand Down
4 changes: 2 additions & 2 deletions src/main/summary.go
Expand Up @@ -23,7 +23,7 @@ func getSummary (text string) string {
sentences := tokenizer.Tokenize(text)
maxN := 0.0
for _, s := range sentences {
str := s.Text
str := s.String()
str = strings.ReplaceAll(str, " and", "")
str = strings.ReplaceAll(str, " the", "")
str = strings.ReplaceAll(str, " a", "")
Expand Down Expand Up @@ -61,7 +61,7 @@ func getSummary (text string) string {

finalS := ""
for _, v := range lines {
finalS += v.s
finalS += v.s + "<\br>"
}

return finalS
Expand Down

0 comments on commit ccbb090

Please sign in to comment.