Kry data van in-verwagting of voltooide transkripsies
Transkribeer live spraak vanaf 'n mikrofone of live stroom
Monitor en bestuur transkripsiestatus met sessies
Vertaal getranskribeer teks na 'n ander taal
Skep 'n tydelike geldigheidsverklaring token vir kliënt kant versoeke
Gemeenskaplike versoek opsies en antwoorde vir alle transkripsie operasies
Skep 'n sessie wat gebruik kan word om 'n live transkripsie via 'n openbare deelbare skakel uit te saai
JavaScriptimport { UrlTranscription } from '@vocalstack/js-sdk'; const sdk = new UrlTranscription({ apiKey: 'YOUR-API-KEY' }); const transcription = await sdk.connect({ url: 'http://example.com/files/meaningless.mp3', }); transcription.start(); // This will print the transcription data as it comes in transcription.onData(console.log); /* { status: 'processing', data: { id: 'd1e7b3b0-7b3b-4b3b-8b3b-0b3b7b3b3b3b', operation: 'transcription-prerecorded', progress: 0.1, timeline: [ { start: 0, end: 7.52, text: 'Meaningless, meaningless, says the teacher, utterly meaningless, everything is meaningless.', language: 'en', translations: { ... }, }, ... ] } } */
JavaScript// Run "npm install @voca l-stack/js-sdk" to install the package import { UrlTranscription } from '@vocalstack/js-sdk'; // Get your key here ⇢ https://www.vocalstack.com/dashboard/api-keys const sdk = new UrlTranscription({ apiKey: 'YOUR-API-KEY' }); const transcription = await sdk.connect({ // URL to the audio file url: 'http://example.com/files/audio.mp3', // Optional: language of the speech spoken // (this can be used to improve the transcription accuracy) language: 'en', // Optional: the maximum duration to transcribe, in seconds // (if not provided, the entire audio file will be transcribed) max_duration_s: 1800, // Optional: the actual duration of the audio file, in seconds // (the transcription starts only if the audio file matches this duration) duration_s: 3600, }); // Start the transcription transcription.start(); // Listen for transcription data transcription.onData((response) => { const { status, data } = response; console.log(status); // 'waiting', 'processing', 'done', or 'error' if (data) { console.log(data.progress); // a value between 0 and 1 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 } });