Skip to content

Commit

Permalink
Merge pull request #15 from Nonhuman-Nonsense/albin
Browse files Browse the repository at this point in the history
Sending recording to parent component in dedicated function
  • Loading branch information
albin-karlsson authored Apr 26, 2024
2 parents 8002493 + 4ad0570 commit c368405
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 c368405

Please sign in to comment.