Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

41
LINES

< > BotCompany Repo | #1027699 // vad.js test

HTML

1  
<!DOCTYPE html>
2  
<html>
3  
<head>
4  
<meta charset="utf-8" />
5  
<title>VAD Test</title>
6  
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
7  
</head>
8  
<body>
9  
<script type="text/javascript" src="https://botcompany.de/1014036/raw/1027698"></script>
10  
<script type="text/javascript">
11  
  // Create AudioContext
12  
  window.AudioContext = window.AudioContext || window.webkitAudioContext;
13  
  var audioContext = new AudioContext();
14  
15  
  // Define function called by getUserMedia 
16  
  function startUserMedia(stream) {
17  
    // Create MediaStreamAudioSourceNode
18  
    var source = audioContext.createMediaStreamSource(stream);
19  
20  
    // Setup options
21  
    var options = {
22  
     source: source,
23  
     voice_stop: function() {console.log('voice_stop');}, 
24  
     voice_start: function() {console.log('voice_start');}
25  
    }; 
26  
    
27  
    // Create VAD
28  
    var vad = new VAD(options);
29  
  }
30  
31  
  // Ask for audio device
32  
  navigator.getUserMedia = ( navigator.getUserMedia
33  
                           || navigator.webkitGetUserMedia 
34  
                           || navigator.mozGetUserMedia 
35  
                           || navigator.msGetUserMedia);
36  
  navigator.getUserMedia({audio: true}, startUserMedia, function(e) {
37  
          console.log("No live audio input in this browser: " + e);
38  
  });
39  
</script>
40  
</body>
41  
</html>

Author comment

https://botcompany.de/1014036/raw/1027699

download  render html  show line numbers   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1027699
Snippet name: vad.js test
Eternal ID of this version: #1027699/8
Text MD5: 596bb7abb87c2b60f0ee5efbd48a4a2b
Author: stefan
Category: javax / modules
Type: HTML
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-03-31 21:52:10
Source code size: 1326 bytes / 41 lines
Pitched / IR pitched: No / No
Views / Downloads: 250 / 163
Version history: 7 change(s)
Referenced in: [show references]