Spaces:
Runtime error
Runtime error
| async function displayTranscription() { | |
| const transcriptionElement = document.getElementById("transcription"); | |
| try { | |
| const response = await fetch("/transcription"); | |
| if (!response.ok) throw new Error("データ取得に失敗しました。"); | |
| const data = await response.json(); | |
| const conversations = data.transcription; | |
| if (!data || !data.transcription) { | |
| throw new Error("会話データが見つかりませんでした。"); | |
| } | |
| /* | |
| const formattedText = conversations | |
| .map((conv) => `【${conv.speaker}】 ${conv.text}`) | |
| .join("\n"); | |
| console.log("フォーマットテキスト:", formattedText); | |
| transcriptionElement.textContent = formattedText; | |
| */ | |
| transcriptionElement.textContent = conversations; | |
| console.log(conversations); | |
| } catch (error) { | |
| transcriptionElement.textContent = `エラー: ${error.message}`; | |
| console.error("データ取得エラー:", error); | |
| } | |
| } | |
| displayTranscription(); | |
| function showRecorder() { | |
| window.location.href = "/index"; | |
| } | |
| function showFeedback() { | |
| window.location.href = "/feedback"; | |
| } | |