File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- const { createClient, LiveTranscriptionEvents } = require ( "../../dist/main/index" ) ;
1+ const {
2+ createClient,
3+ LiveTranscriptionEvents,
4+ LiveTranscriptionEvent,
5+ } = require ( "../../dist/main/index" ) ;
26const fetch = require ( "cross-fetch" ) ;
37
48const live = async ( ) => {
59 const url = "http://stream.live.vc.bbcmedia.co.uk/bbc_world_service" ;
610
711 const deepgram = createClient ( process . env . DEEPGRAM_API_KEY ) ;
812
9- const connection = deepgram . listen . live ( { model : "general" , tier : "enhanced" } ) ;
13+ const connection = deepgram . listen . live ( {
14+ model : "nova-2" ,
15+ utterance_end_ms : 1500 ,
16+ interim_results : true ,
17+ } ) ;
1018
1119 connection . on ( LiveTranscriptionEvents . Open , ( ) => {
1220 connection . on ( LiveTranscriptionEvents . Close , ( ) => {
@@ -18,6 +26,14 @@ const live = async () => {
1826 } ) ;
1927
2028 connection . on ( LiveTranscriptionEvents . Transcript , ( data ) => {
29+ console . log ( data . channel ) ;
30+ } ) ;
31+
32+ connection . on ( LiveTranscriptionEvents . UtteranceEnd , ( data ) => {
33+ console . log ( data ) ;
34+ } ) ;
35+
36+ connection . on ( LiveTranscriptionEvents . SpeechStarted , ( data ) => {
2137 console . log ( data ) ;
2238 } ) ;
2339
You can’t perform that action at this time.
0 commit comments