Compare commits

..

23 Commits

Author SHA1 Message Date
Aarthi Manivannan, Premanathan Aarthi Manivannan c00640c15d Update file meeting_report_prompt.txt 2025-12-14 11:52:21 +01:00
Aarthi Manivannan, Premanathan Aarthi Manivannan d80941ca65 Delete .gitkeep 2025-12-14 11:45:47 +01:00
Aarthi Manivannan, Premanathan Aarthi Manivannan 0e4147e893 Delete meeting_report_template.md 2025-12-14 11:45:38 +01:00
Aarthi Manivannan, Premanathan Aarthi Manivannan 9ab69b4b36 Delete .gitkeep 2025-12-14 11:44:59 +01:00
Aarthi Manivannan, Premanathan Aarthi Manivannan cd61d8e09b Delete transcript.txt 2025-12-14 11:44:51 +01:00
Aarthi Manivannan, Premanathan Aarthi Manivannan 893546d142 Delete Example_output.pdf.pdf 2025-12-14 11:44:41 +01:00
Aarthi Manivannan, Premanathan Aarthi Manivannan 9098dafbd5 Delete .gitkeep 2025-12-14 11:44:16 +01:00
Aarthi Manivannan, Premanathan Aarthi Manivannan d68192de8a Delete meeting_report_prompt.txt 2025-12-14 11:44:06 +01:00
Aarthi Manivannan, Premanathan Aarthi Manivannan 5a23ec9c2f Delete .gitkeep 2025-12-14 11:43:24 +01:00
Aarthi Manivannan, Premanathan Aarthi Manivannan a0237ade55 Delete meeting_report_structure.json 2025-12-14 11:39:09 +01:00
Aarthi Manivannan, Premanathan Aarthi Manivannan 10e3c902c5 Delete meeting_report_best_practices.md 2025-12-14 11:37:32 +01:00
Aarthi Manivannan, Premanathan Aarthi Manivannan b157a90671 Upload New File 2025-11-20 12:24:46 +01:00
Aarthi Manivannan, Premanathan Aarthi Manivannan 6931df22e0 Add new file 2025-11-20 12:12:42 +01:00
Aarthi Manivannan, Premanathan Aarthi Manivannan 9eaabe80b6 Add new directory 2025-11-20 12:09:35 +01:00
Aarthi Manivannan, Premanathan Aarthi Manivannan db2192dc30 Add new file 2025-11-20 12:02:32 +01:00
Aarthi Manivannan, Premanathan Aarthi Manivannan 76129982c3 Update file meeting_report_prompt.txt 2025-11-20 11:59:16 +01:00
Aarthi Manivannan, Premanathan Aarthi Manivannan ea769d3aec Add new file 2025-11-20 11:41:14 +01:00
Aarthi Manivannan, Premanathan Aarthi Manivannan 21f4fe95d7 Add new file 2025-11-20 11:38:32 +01:00
Aarthi Manivannan, Premanathan Aarthi Manivannan 8e07bcf028 Add new file 2025-11-20 11:35:47 +01:00
Aarthi Manivannan, Premanathan Aarthi Manivannan fd0798872a Add new directory 2025-11-20 11:32:46 +01:00
Aarthi Manivannan, Premanathan Aarthi Manivannan 0ea3fba436 Add new directory 2025-11-20 11:32:20 +01:00
Aarthi Manivannan, Premanathan Aarthi Manivannan 5615f7fd25 research and design 2025-11-20 11:29:33 +01:00
Hughes, Mike 283b4ed6af Merge branch 'develop' into 'main'
Implemented the general modular framework.

See merge request proj-wise2526-video2document/video2document!22
2025-11-15 15:14:24 +01:00
12 changed files with 162 additions and 12804 deletions
-3
View File
@@ -12,9 +12,6 @@ try {
contextBridge.exposeInMainWorld("electronAPI", { contextBridge.exposeInMainWorld("electronAPI", {
getFilePath: (file) => {return webUtils.getPathForFile(file)} getFilePath: (file) => {return webUtils.getPathForFile(file)}
}) })
contextBridge.exposeInMainWorld("summarizer", {
runFile: (file) => ipcRenderer.send("summarize-transcription", file)
});
} catch (error) { } catch (error) {
console.log("Error in preload.js"); console.log("Error in preload.js");
} }
+3 -9
View File
@@ -16,21 +16,15 @@ uploadContainer.addEventListener("drop", (e) => {
e.preventDefault() e.preventDefault()
const files = e.dataTransfer.files const files = e.dataTransfer.files
const filePath = window.explorer.onFileDrop(files[0]) const filePath = window.explorer.onFileDrop(files[0])
var holdy = filePath + "";
if(holdy.endsWith(".mp4") || holdy.endsWith(".mov") || holdy.endsWith(".avi") || holdy.endsWith( ".mkv")){
console.log(filePath)
var holdy = String(filePath);
const lower = holdy.toLowerCase();
const validExt = [".mp4", ".mov", ".avi", ".mkv"];
if(validExt.some(ext => lower.endsWith(ext))){
console.log(filePath);
const files1 = e.dataTransfer.files; const files1 = e.dataTransfer.files;
handleFiles(files1); handleFiles(files1);
}else{
console.log('Video format invalid!');
} }
} catch (error) { } catch (error) {
console.log("Error in renderer.js with the listerner for the drop function"); console.log("Error in renderer.js with the listerner for the drop function");
console.log(error);
} }
+43 -49
View File
@@ -6,7 +6,7 @@ manualUploadBtn.addEventListener('click', () => {
} catch (error) { } catch (error) {
console.log("Error in manualBtn EventListener click"); console.log("Error in manualBtn EventListener click");
} }
}); });
//function to check if one checkbox is at least klicked //function to check if one checkbox is at least klicked
@@ -15,24 +15,18 @@ function checkBoxes() {
const checkboxes = document.querySelectorAll('input[name="docFormat"]'); const checkboxes = document.querySelectorAll('input[name="docFormat"]');
let isChecked = false; let isChecked = false;
checkboxes.forEach(function (checkbox) { checkboxes.forEach(function(checkbox){
if (checkbox.checked) { if(checkbox.checked){
isChecked = true; isChecked = true;
} }
}); });
if (isChecked) { if(isChecked){
//Code to submit the video //Code to submit the video
var pathTest = window.electronAPI.getFilePath(videoUpload.files[0]); var pathTest = window.electronAPI.getFilePath(videoUpload.files[0]);
if(pathTest.endsWith(".mp4") || holdy.endsWith(".mov") || holdy.endsWith(".avi") || holdy.endsWith( ".mkv")){
const lower = pathTest.toLowerCase(); window.extractor.extract({inputVideoPath: pathTest, outputType:"wav"})
const validExt = [".mp4", ".mov", ".avi", ".mkv"];
if(validExt.some(ext => lower.endsWith(ext))){
window.extractor.extract({ inputVideoPath: pathTest, outputType: "wav" });
} }
} else { } else {
//language only english at the moment //language only english at the moment
alert('Please select at least one document type.'); alert('Please select at least one document type.');
@@ -40,43 +34,43 @@ function checkBoxes() {
} catch (error) { } catch (error) {
console.log(error) console.log(error)
} }
// mapFunctions.get("extraction-video-to-audio").function({inputVideoPath:"./a.mp4", outputType:"wav"}) // mapFunctions.get("extraction-video-to-audio").function({inputVideoPath:"./a.mp4", outputType:"wav"})
} }
//language changing feature //language changing feature
function changeLanguage(language) { function changeLanguage(language) {
if (language === 'en') { if (language === 'en') {
document.getElementById('title').textContent = 'Video to document'; document.getElementById('title').textContent = 'Video to document';
document.getElementById('h1').textContent = 'Video to document'; document.getElementById('h1').textContent = 'Video to document';
document.getElementById('p1').textContent = 'Drag and drop video file'; document.getElementById('p1').textContent = 'Drag and drop video file';
document.getElementById('fileName').textContent = 'No video chosen'; document.getElementById('fileName').textContent = 'No video chosen';
document.getElementById('manualUploadBtn').textContent = 'Search video'; document.getElementById('manualUploadBtn').textContent = 'Search video';
document.getElementById('checkbox_group').textContent = 'Choose prefered document style:'; document.getElementById('checkbox_group').textContent = 'Choose prefered document style:';
document.getElementById('label_format').textContent = 'Meeting report'; document.getElementById('label_format').textContent = 'Meeting report';
document.getElementById('label_summary').textContent = 'Summary with timestamps'; document.getElementById('label_summary').textContent = 'Summary with timestamps';
document.getElementById('submitButton').textContent = 'Submit'; document.getElementById('submitButton').textContent = 'Submit';
} else if (language === 'de') { } else if (language === 'de') {
document.getElementById('title').textContent = 'Video zu Dokument'; document.getElementById('title').textContent = 'Video zu Dokument';
document.getElementById('h1').textContent = 'Video zu Dokument'; document.getElementById('h1').textContent = 'Video zu Dokument';
document.getElementById('p1').textContent = 'Video per Drag & Drop ablegen'; document.getElementById('p1').textContent = 'Video per Drag & Drop ablegen';
document.getElementById('fileName').textContent = 'Kein Video ausgewaehlt'; document.getElementById('fileName').textContent = 'Kein Video ausgewaehlt';
document.getElementById('manualUploadBtn').textContent = 'Video suchen'; document.getElementById('manualUploadBtn').textContent = 'Video suchen';
document.getElementById('checkbox_group').textContent = 'Bevorzugte Dokumentvarianten:'; document.getElementById('checkbox_group').textContent = 'Bevorzugte Dokumentvarianten:';
document.getElementById('label_format').textContent = 'Meeting Bericht'; document.getElementById('label_format').textContent = 'Meeting Bericht';
document.getElementById('label_summary').textContent = 'Zusammenfassung mit Zeitstempeln'; document.getElementById('label_summary').textContent = 'Zusammenfassung mit Zeitstempeln';
document.getElementById('submitButton').textContent = 'Absenden'; document.getElementById('submitButton').textContent = 'Absenden';
} else if (language == "in") { } else if(language == "in") {
document.getElementById('title').textContent = 'दस्तावेज़ के लिए वीडियो'; document.getElementById('title').textContent = 'दस्तावेज़ के लिए वीडियो';
document.getElementById('h1').textContent = 'दस्तावेज़ के लिए वीडियो'; document.getElementById('h1').textContent = 'दस्तावेज़ के लिए वीडियो';
document.getElementById('p1').textContent = 'वीडियो फ़ाइल खींचें और छोड़ें'; document.getElementById('p1').textContent = 'वीडियो फ़ाइल खींचें और छोड़ें';
document.getElementById('fileName').textContent = 'कोई वीडियो नहीं चुना गया'; document.getElementById('fileName').textContent = 'कोई वीडियो नहीं चुना गया';
document.getElementById('manualUploadBtn').textContent = 'वीडियो खोजें'; document.getElementById('manualUploadBtn').textContent = 'वीडियो खोजें';
document.getElementById('checkbox_group').textContent = 'पसंदीदा दस्तावेज़ शैली चुनें:'; document.getElementById('checkbox_group').textContent = 'पसंदीदा दस्तावेज़ शैली चुनें:';
document.getElementById('label_format').textContent = 'बैठक रिपोर्ट'; document.getElementById('label_format').textContent = 'बैठक रिपोर्ट';
document.getElementById('label_summary').textContent = 'टाइमस्टैम्प के साथ सारांश'; document.getElementById('label_summary').textContent = 'टाइमस्टैम्प के साथ सारांश';
document.getElementById('submitButton').textContent = 'जमा करना'; document.getElementById('submitButton').textContent = 'जमा करना';
} }
} }
@@ -87,7 +81,7 @@ videoUpload.addEventListener('change', () => {
} catch (error) { } catch (error) {
console.log("Error in manualBtn EventListener change"); console.log("Error in manualBtn EventListener change");
} }
}); });
@@ -105,11 +99,11 @@ function handleFiles(files) {
} catch (error) { } catch (error) {
console.log("Error in script.js handleFiles function"); console.log("Error in script.js handleFiles function");
} }
} }
//function to regulate the progress on the progressbar //function to regulate the progress on the progressbar
function updateProgressBar(bar, value) { function updateProgressBar(bar, value){
try { try {
value = Math.round(value); value = Math.round(value);
bar.querySelector(".progress_fill").style.width = `${value}%`; bar.querySelector(".progress_fill").style.width = `${value}%`;
@@ -117,5 +111,5 @@ function updateProgressBar(bar, value) {
} catch (error) { } catch (error) {
console.log("Error in scripts.js updateProgressBar function"); console.log("Error in scripts.js updateProgressBar function");
} }
} }
+1 -6
View File
@@ -76,9 +76,4 @@ electron.app.whenReady().then(createWindow);
electron.ipcMain.on("extract", (event, args) => { electron.ipcMain.on("extract", (event, args) => {
mapFunctions.get("extraction-video-to-audio").function(args) mapFunctions.get("extraction-video-to-audio").function(args)
}) })
electron.ipcMain.on("summarize-transcription", (event, args) => {
mapFunctions.get("summarize-transcription").function(args);
});
+109
View File
@@ -0,0 +1,109 @@
Generate a structured meeting report in MARKDOWN using STRUCTURE and STYLE.
Output ONLY the final .md document — no meta comments, no explanations.
Follow exactly the STRUCTURE defined below.
Follow exactly the STYLE rules.
Use timestamps in HH:MM:SS format.
If information is missing, use: UNKLAR:<reason>.
==================== STRUCTURE & RULES ====================
{
"FORMAT": "markdown",
"STRUCTURE": {
"titlepage": [
"title",
"date",
"start",
"end",
"duration",
"location",
"host",
"participants"
],
"toc": "[section](#anchor) — HH:MM:SS",
"section": {
"h2": "<topic> — HH:MM:SS",
"summary": "exactly 1 concise sentence",
"key_points": "maximum 5 bullet points; quotes optional",
"decisions": "list items formatted as: decision text | owner | due date",
"actions": "markdown table: id | task | owner | due | status"
},
"exec_summary": "exactly 3 short sentences",
"consolidated": [
"decisions",
"actions"
],
"appendix": "optional"
},
"STYLE": {
"tone": "neutral, concise, professional",
"ts_format": "HH:MM:SS",
"no_meta": true
},
"PROCESS": {
"timestamps": "use transcript timestamps if present; otherwise estimate minimal",
"speakers": "use names if available; else Speaker X",
"long_transcripts": "split → summarize → merge",
"unclear": "UNKLAR:<reason>"
},
"PROMPT_SNIPPET": "Generate meeting report in markdown using STRUCTURE and STYLE. Output only the report."
}
============================================================
Insert all generated content into the following MARKDOWN TEMPLATE:
# {{title}}
**Date:** {{date}}
**Start:** {{start}}
**End:** {{end}}
**Duration:** {{duration}}
**Location:** {{location}}
**Host:** {{host}}
**Participants:** {{participants}}
---
## Table of Contents
{{toc}}
---
## Executive Summary
{{exec_summary}}
---
## Sections
{{sections}}
---
## Consolidated Decisions
{{consolidated_decisions}}
---
## Consolidated Actions
{{consolidated_actions}}
---
## Appendix
{{appendix}}
============================================================
Final Requirement:
Output ONLY the completed Markdown meeting report.
@@ -1,138 +0,0 @@
const fs = require("fs");
const path = require("path");
// Prepare output directory (always storage/transcriptionSummaries under project root)
const outputDir = `${__dirname}/../../../storage/transcriptionSummaries`;
if (!fs.existsSync(outputDir)) {
fs.mkdirSync(outputDir, { recursive: true });
}
//Speaker, ALL-Sentences, Start, End
module.exports = {
name: "summarize-transcription", // Unique name for our function that will later be used to get the function from the map via "mapFunctions.get("example").function()"
type: "summarizer", // value used to differentiate each module to order them in the UI
displayname: "Summarizer", // The displayname used within the UI
async function(args) {
let inputJson = args.json;
//JSON Path
if (args.jsonPath) {
try {
const raw = fs.readFileSync(args.jsonPath, "utf-8");
inputJson = JSON.parse(raw);
} catch (e) {
console.error("Failed to load JSON from file:", e);
return { error: "Could not read JSON from file path." };
}
}
// JSON parsen
if (typeof inputJson === "string") {
try {
inputJson = JSON.parse(inputJson);
} catch (e) {
console.log("Invalid JSON in summarize-transcription");
return { error: "Invalid JSON" };
}
}
const words = inputJson.words;
if (!Array.isArray(words)) {
return { error: "No words Array found" };
}
const ENDINGS = [".", "!", "?"]; // '...' auch als Satzende ?
const ABBREVIATIONS = new Set(["z.B.", "bzw.", "u.a.", "Dr.", "Mr.", "Mrs.", "Prof.", "etc."]); //TODO weitere Ergaenzen
const result = [];
let currentSentence = "";
let currentSpeaker = null;
let startTime = null;
let endTime = null;
for (const w of words) {
if (!currentSpeaker) currentSpeaker = w.speaker;
if (startTime === null) startTime = w.start;
endTime = w.end;
//speaker changing
if (currentSpeaker !== w.speaker && currentSentence) {
const lastEntry = result[result.length - 1];
if (lastEntry && lastEntry.speaker === currentSpeaker) {
lastEntry.sentence += " " + currentSentence;
lastEntry.end = endTime;
} else {
result.push({
speaker: currentSpeaker,
sentence: currentSentence,
start: startTime,
end: endTime
});
}
currentSentence = "";
startTime = w.start;
}
currentSpeaker = w.speaker;
currentSentence += (currentSentence ? " " : "") + w.text; //sentence beginning or not
const lastWord = w.text.trim();
const lastChar = lastWord.slice(-1);
const isAbbreviation = ABBREVIATIONS.has(lastWord);
//sentence ending
if (ENDINGS.includes(lastChar) && !isAbbreviation) {
const lastEntry = result[result.length - 1];
if (lastEntry && lastEntry.speaker === currentSpeaker) {
lastEntry.sentence += " " + currentSentence;
lastEntry.end = endTime;
} else {
result.push({
speaker: currentSpeaker,
sentence: currentSentence,
start: startTime,
end: endTime
});
}
currentSentence = "";
startTime = null;
endTime = null;
currentSpeaker = null;
}
}
// safe last sentence
if (currentSentence) {
const lastEntry = result[result.length - 1];
if (lastEntry && lastEntry.speaker === currentSpeaker) {
lastEntry.sentence += " " + currentSentence;
lastEntry.end = endTime;
} else {
result.push({
speaker: currentSpeaker,
sentence: currentSentence,
start: startTime,
end: endTime
});
}
}
// Output as Text
const output = result.map(r =>
`Sprecher ${r.speaker} [${r.start.toFixed(2)} - ${r.end.toFixed(2)}]: ${r.sentence}`
);
// Output on cosole
//console.log("\n------------\nMerged Transcription Result:\n", output, "\n------------\n");
try {
const jsonPath = path.join(outputDir, "transcription_result.json");
fs.writeFileSync(jsonPath, JSON.stringify(result, null, 2), "utf-8");
const txtPath = path.join(outputDir, "transcription_result.txt");
fs.writeFileSync(txtPath, output.join("\n"), "utf-8");
console.log(`Summary successfully saved:\n- ${jsonPath}\n- ${txtPath}`);
} catch (err) {
console.error("Error saving Summary:", err);
}
}
}
@@ -1,121 +0,0 @@
const fs = require("fs");
const path = require("path");
// Prepare output directory (always storage/transcriptionSummaries under project root)
const outputDir = `${__dirname}/../../../storage/transcriptionSummaries`;
if (!fs.existsSync(outputDir)) {
fs.mkdirSync(outputDir, { recursive: true });
}
//Speaker, Sentence, Start, End
module.exports = {
name: "summarize-transcription2", // Unique name for our function that will later be used to get the function from the map via "mapFunctions.get("example").function()"
type: "summarizer", // value used to differentiate each module to order them in the UI
displayname: "Summarizer", // The displayname used within the UI
async function(args) {
let inputJson = args.json;
//JSON Path
if (args.jsonPath) {
try {
const raw = fs.readFileSync(args.jsonPath, "utf-8");
inputJson = JSON.parse(raw);
} catch (e) {
console.error("Failed to load JSON from file:", e);
return { error: "Could not read JSON from file path." };
}
}
// JSON parsen
if (typeof inputJson === "string") {
try {
inputJson = JSON.parse(inputJson);
} catch (e) {
console.log("Invalid JSON in summarize-transcription");
return { error: "Invalid JSON" };
}
}
const words = inputJson.words;
if (!Array.isArray(words)) {
return { error: "No words Array found" };
}
const ENDINGS = [".", "!", "?"]; // '...' auch als Satzende ?
const ABBREVIATIONS = new Set(["z.B.", "bzw.", "u.a.", "Dr.", "Mr.", "Mrs.", "Prof.", "etc."]); //TODO weitere Ergaenzen
const result = [];
let currentSentence = "";
let currentSpeaker = null;
let startTime = null;
let endTime = null;
for (const w of words) {
if (!currentSpeaker) currentSpeaker = w.speaker;
if (startTime === null) startTime = w.start;
endTime = w.end;
//speaker changing
if (currentSpeaker !== w.speaker && currentSentence) {
result.push({
speaker: currentSpeaker,
sentence: currentSentence,
start: startTime,
end: endTime
});
currentSentence = "";
startTime = w.start;
}
currentSpeaker = w.speaker;
currentSentence += (currentSentence ? " " : "") + w.text; //sentence beginning or not
const lastWord = w.text.trim();
const lastChar = lastWord.slice(-1);
const isAbbreviation = ABBREVIATIONS.has(lastWord);
//sentence ending
if (ENDINGS.includes(lastChar) && !isAbbreviation) {
result.push({
speaker: currentSpeaker,
sentence: currentSentence,
start: startTime,
end: endTime
});
currentSentence = "";
startTime = null;
endTime = null;
currentSpeaker = null;
}
}
// safe last sentence
if (currentSentence) {
result.push({
speaker: currentSpeaker,
sentence: currentSentence,
start: startTime,
end: endTime
});
}
// Output as Text
const output = result.map(r =>
`Sprecher ${r.speaker} [${r.start.toFixed(2)} - ${r.end.toFixed(2)}]: ${r.sentence}`
);
// Output on cosole
//console.log("\n------------\nMerged Transcription Result:\n", output, "\n------------\n");
try {
const jsonPath = path.join(outputDir, "transcription_result.json");
fs.writeFileSync(jsonPath, JSON.stringify(result, null, 2), "utf-8");
const txtPath = path.join(outputDir, "transcription_result.txt");
fs.writeFileSync(txtPath, output.join("\n"), "utf-8");
console.log(`Summary successfully saved:\n- ${jsonPath}\n- ${txtPath}`);
} catch (err) {
console.error("Error saving Summary:", err);
}
}
}
@@ -1,123 +1,8 @@
require('dotenv').config();
const API_KEY = process.env.API_KEY;
const BASE_URL = 'https://api.assemblyai.com/v2';
//---------------------------------------------------Upload audio---------------------------------------------------
async function uploadAudio(audioPath) {
const audioData = fs.readFileSync(audioPath);
const response = await axios.post(`${BASE_URL}/upload`, audioData, {
headers: {
authorization: API_KEY,
'content-type': 'application/octet-stream'
}
});
return response.data.upload_url;
}
////---------------------------------------------------Extract session id---------------------------------------------------
function getSessionId(inputPath) {
try {
const parsed = new URL(inputPath);
const base = path.basename(parsed.pathname);
return base.replace(/\.[^.]+$/, '');
} catch {
return path.basename(inputPath, path.extname(inputPath));
}
}
//---------------------------------------------------Create transcript---------------------------------------------------
async function createTranscript(audioUrl) {
const response = await axios.post(
`${BASE_URL}/transcript`,
{
audio_url: audioUrl,
speaker_labels: true,
language_detection: true
},
{
headers: {
authorization: API_KEY,
'content-type': 'application/json'
}
}
);
return response.data.id;
}
//---------------------------------------------------Poll transcript---------------------------------------------------
async function pollTranscript(transcriptId) {
while (true) {
const response = await axios.get(`${BASE_URL}/transcript/${transcriptId}`, {
headers: { authorization: API_KEY }
});
const status = response.data.status;
if (status === 'completed') return response.data;
if (status === 'error') throw new Error(`Transcription failed: ${response.data.error}`);
await new Promise(res => setTimeout(res, 3000));
}
}
//---------------------------------------------------Save transcript---------------------------------------------------
function saveTranscript(transcript, sessionId) {
const outputDir = path.join(__dirname, '../../../storage/transcripts');
if (!fs.existsSync(outputDir)) {
fs.mkdirSync(outputDir, { recursive: true });
}
const outputPath = path.join(outputDir, `${sessionId}.json`);
fs.writeFileSync(outputPath, JSON.stringify(transcript, null, 2));
console.log(`Transcript saved: ${outputPath}`);
}
//---------------------------------------------------Modul---------------------------------------------------
module.exports = { module.exports = {
name: 'assembly', name:"assembly", // Unique name for our function that will later be used to get the function from the map via "mapFunctions.get("example").function()"
type: 'transcription', type:"transcription", // value used to differentiate each module to order them in the UI
displayname: 'AssemblyAI', displayname:"Assembly", // The displayname used within the UI
async function(parameter){
async function(audioFileName) { // TODO add code to actually process the audio file
try {
// audioFileName ist nur "datei.mp3"
const audioPath = path.join(
__dirname,
'../../../storage/audio',
audioFileName
);
let audioUrl;
if (/^https?:\/\//i.test(audioFileName)) {
audioUrl = audioFileName;
} else {
if (!fs.existsSync(audioPath)) {
throw new Error(`Audio file not found: ${audioPath}`);
}
audioUrl = await uploadAudio(audioPath);
}
const transcriptId = await createTranscript(audioUrl);
const transcript = await pollTranscript(transcriptId);
const sessionId = getSessionId(audioFileName);
saveTranscript(transcript, sessionId);
} catch (error) {
console.error('Transcription error:', error.message);
} }
} }
};
-7
View File
@@ -6,13 +6,6 @@ module.exports = {
// We are now calling the example function from the example folder // We are now calling the example function from the example folder
mapFunctions.get("example").function("Startup") mapFunctions.get("example").function("Startup")
let transcript = await mapFunctions.get("assembly").function('../../storage/audio/IMG_2978.wav');
let summary = await mapFunctions.get("summarize-transcription").function({jsonPath:'/Users/santa/Proj25/video2document/storage/transcripts/IMG_2978.json'});
// mapFunctions.get("extraction-video-to-audio").function({inputVideoPath:"./a.mp4", outputType:"wav"}) // mapFunctions.get("extraction-video-to-audio").function({inputVideoPath:"./a.mp4", outputType:"wav"})
// mapFunctions.get("extraction-video-to-audio").function({inputVideoPath:"./b.mp4", outputType:"wav"}) // mapFunctions.get("extraction-video-to-audio").function({inputVideoPath:"./b.mp4", outputType:"wav"})
// mapFunctions.get("extraction-video-to-audio").function({inputVideoPath:"./b.mp4", outputType:"flac"}) // mapFunctions.get("extraction-video-to-audio").function({inputVideoPath:"./b.mp4", outputType:"flac"})
-18
View File
@@ -1,18 +0,0 @@
require('dotenv').config();
const path = require('path');
const assemblyModule = require('../../services/modules/transcription-remote/assembly.js');
// Audio-Datei oder URL aus Kommandozeile, Standard: test.wav
const audioPath = process.argv[2] || './storage/audio/IMG_2978.wav';
(async () => {
try {
const transcript = await assemblyModule.run(audioPath);
console.log('Transcription succesful');
console.log('Transcript ID:', transcript?.id);
console.log('Speaker labels:', transcript?.utterances?.length || 0);
} catch (error) {
console.error('Error in Transcription:', error?.message || error);
}
})();
File diff suppressed because it is too large Load Diff
@@ -1,12 +0,0 @@
const fs = require('fs');
const transSummarizer = require("../../services/modules/jsonTools/transcriptionSummarizer.js");
// JSON-Datei laden
const inputJson = JSON.parse(fs.readFileSync("./testFile.json", "utf8"));
// Übergabe an den Summarizer
transSummarizer.function({
json: inputJson
});