Skip to content

Commit

Permalink
Sending recording to parent component in dedicated function
Browse files Browse the repository at this point in the history
  • Loading branch information
albin-karlsson committed Apr 26, 2024
1 parent 1496c5b commit 4ad0570
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/src/components/HumanInput.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from "react";

function HumanInput({ onAddNewTopic }) {
function HumanInput({ onAddNewTopic, onStopRecording }) {
const [recording, setRecording] = useState(false);
const [mediaRecorder, setMediaRecorder] = useState(null);

Expand All @@ -27,7 +27,7 @@ function HumanInput({ onAddNewTopic }) {
console.log("Stopping recording...");

// Optionally handle the audio blob by sending it to a parent component
onAddNewTopic(audioUrl); // Sending the URL for the audio blob to the parent
onStopRecording(audioUrl); // Sending the URL for the audio blob to the parent
audioChunks = []; // Clear chunks
};
})
Expand Down

0 comments on commit 4ad0570

Please sign in to comment.