Documentation

Kupata data ya kutafsiri

Kupata data kutoka kusitishwa au kukamilika transcriptions

Mafunzo ya kutafsiri

Kufuatilia na kudhibiti hali ya transcription na mikutano

Kutafsiri Transcription

Kutafsiri maandishi transcribed kwa lugha nyingine

Kuhamisha Audio kutoka URL

Kuandika hotuba kutoka sauti iliyorekodiwa katika URL hadi maandishi ya kawaida

Mteja upande Uthibitishaji Tokens

Kujenga muda authentication token kwa maombi upande wa mteja

Maombi ya kutafsiri na Majibu

Common maombi chaguzi na majibu kwa ajili ya shughuli zote transcription

Kuandika na Kuwasilisha Sehemu ya Polyglot

Kuunda mkutano ambao unaweza kutumika kwa ajili ya kutangaza kuishi transcription kupitia umma shareable kiungo

Kuandika kutoka kwa Mikrofoni au LiveStream

Tazama nyaraka
Kuandika hotuba ya moja kwa moja kutoka kwa mikrofoni au mtiririko wa moja kwa moja. Kuunganisha na Polyglot ili kuunda kiungo cha umma cha kushiriki kwa ajili ya tafsiri ambayo watumiaji wanaweza kusoma katika lugha yoyote.
Kuandika kutoka kwa mikrofoni lazima daima kutuma audio data mkondo packets kwa VocalStack API.
JavaScript
import { LiveTranscription } from '@vocalstack/js-sdk'; const sdk = new LiveTranscription({ apiKey: 'YOUR-API-KEY' }); const stream = await sdk.connect({ // Optional: Integrate this stream with a Polyglot session polyglot_id: 'YOUR-POLYGLOT-SESSION-ID', // Optional: language of the speech spoken // (this can be used to improve the transcription accuracy) language: 'en', // Optional: Translate the transcription to these languages translations: ['de'], // Optional: Stop the stream after this many seconds of inactivity timeout_period_s: 60, // Optional: Hard stop the stream after this many seconds max_duration_s: 300, }); // Start the stream stream.start(); // Get audio data from a microphone and send it to the stream // stream.sendBuffer(buffer); // *** This is a placeholder for the actual implementation *** // Manually stop the stream (in this example, after 60 seconds) // If max_duration_s is set, stopping the stream is optional setTimeout(() => stream.stop(), 60000); // Listen for stream transcription data stream.onData((response) => { const { status, data } = response; console.log(status); // 'waiting', 'processing', 'done', 'stopping' or 'error' if (data) { console.log(data.timeline); // an object with the transcription timeline } if (status === 'done') { console.log(data.summary); // a summary of the transcription console.log(data.keywords); // an array of keywords console.log(data.paragraphs); // the entire transcription in paragraph form } });
Kupata data ya mkondo wa sauti itatofautiana kulingana na mazingira ambapo unataka kutekeleza uendeshaji wa kuandika. Hapa kuna mifano michache ya jinsi unavyoweza kufanya hivyo:
Katika NextJS unapaswa kufunga package ambayo inaweza fetch data audio kutoka kifaa chako, ambayo unaweza kisha mbele ya VocalStack API. Hapa ni mfano:
JavaScript
const mic = require('mic'); // Create a new instance of the microphone utility const micInstance = mic(); // Get the audio input stream const micStream = micInstance.getAudioStream(); // Capture the audio data from the microphone micStream.on('data', (data) => { stream.sendBuffer(data); // send the buffer data to the VocalStack API }); // Start capturing audio from the microphone micInstance.start();
Katika kivinjari cha wavuti unaweza kutaka kutumia MediaRecorder API kama inaweza kuonekana katika mfano ifuatayo. (Inaweza pia kuwa wazo nzuri ya kutumia package kama recordrtc ambayo inaboresha utangamano browser)
JavaScript
// Request access to the microphone const mediaStream = await navigator.mediaDevices.getUserMedia({ audio: true }); // Create a MediaRecorder instance to capture audio data const mediaRecorder = new MediaRecorder(mediaStream); // Event handler to process audio data packets mediaRecorder.ondataavailable = async (event) => { const blob = event.data; // this is the audio packet (Blob) const buffer = await blob.arrayBuffer(); // convert the Blob to a Buffer stream.sendBuffer(buffer); // send the buffer data to the VocalStack API }; // Start capturing audio, and send it to the stream every second mediaRecorder.start(1000);
Kumbuka kwamba kwa ajili ya upatikanaji wa VocalStack API kwenye wateja wa mtandao unahitaji kutumia token auth:
Mteja upande Uthibitishaji Tokens
Kujenga muda authentication token kwa maombi upande wa mteja. Salama kutekeleza maombi API katika browsers wavuti bila kuonyesha vifungo API yako.
VocalStack API inaweza kutumika kutafsiri URL yoyote ya HLS LiveStream, ikiwa ni pamoja na vyanzo kama vile Youtube Live, Facebook Live, na Twitch. Tafadhali kumbuka kwamba mkondo URL lazima kuwa .m3u8 faili upanuzi kwamba inawakilisha halali HLS (HTTP Live Streaming) playlist faili.
JavaScript
import { LiveTranscription } from '@vocalstack/js-sdk'; const sdk = new LiveTranscription({ apiKey: 'YOUR-API-KEY' }); const stream = await sdk.connect({ // must be a valid HLS streaming protocol livestream_url: 'http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/nonuk/sbr_low/ak/bbc_world_service.m3u8', // The rest of these options are the same as for microphone live transcriptons }); stream.start(); stream.onData((response) => { // The response object is the same as the one // returned by microphone transcriptions });
Kuunganisha transcriptions kuishi na Polyglot ni rahisi kama kuongeza polyglot_id chaguo kwa ombi transcription, kama inavyoonyeshwa katika mifano hapo juu.
Polyglot huunda kiungo cha umma cha kushirikiana na maandishi yako (kiungo kinaweza kuwa na Password iliyohifadhiwa):
  • Watumiaji wanaweza kusoma transcription yako katika muda halisi kwa kutumia kiungo.
  • Watumiaji wanaweza kuchagua lugha ambayo kusoma transcription katika muda halisi.
  • Watumiaji wanaweza kusoma transcription yako katika wakati baadaye, na transcriptions nyingine zote kuunganishwa na mkutano wako Polyglot maalum.
Unaweza kutumia VocalStack API na kutekeleza yako mwenyewe nyeupe labelled UI badala ya kutumia moja iliyotolewa na VocalStack. Tungependa kusikia kuhusu hilo kama wewe kufanya, ili tuweze kujifunza kuhusu jinsi ya kufanya bidhaa yetu bora!
Kujifunza zaidi kuhusu jinsi Polyglot kazi katika vocalstack.com/kiingereza.
Kuandika na Kuwasilisha Sehemu ya Polyglot
Kuunda mkutano ambao unaweza kutumika kwa ajili ya kutangaza kuishi transcription kupitia umma shareable kiungo. Watumiaji wanaweza kusoma transcriptions kuishi katika lugha yao preferred, na hata transcriptions zamani wakati mkutano wako ni pasipo na shughuli.
Kupata data ya kutafsiri
Kupata data kutoka kusitishwa au kukamilika transcriptions. Hii ni pamoja na transcription timeline, maneno muhimu, muhtasari, na aya sehemu.
Mteja upande Uthibitishaji Tokens
Kujenga muda authentication token kwa maombi upande wa mteja. Salama kutekeleza maombi API katika browsers wavuti bila kuonyesha vifungo API yako.
Scroll Up