forked from React-Group/interstellar_ai
Merge branch 'main' of interstellardevelopment.org:sageTheDm/interstellar_ai
This commit is contained in:
commit
ca35ab1d04
1 changed files with 1 additions and 15 deletions
|
@ -198,20 +198,6 @@ const InputOutputBackend: React.FC = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const convertOggToWav = async (oggFile: File | Blob) => {
|
|
||||||
await loadFFmpeg()
|
|
||||||
|
|
||||||
const ffmpeg = ffmpegRef.current!
|
|
||||||
|
|
||||||
await ffmpeg.writeFile("input.ogg", await fetchFile(oggFile))
|
|
||||||
await ffmpeg.exec(["-i", "input.ogg", "output.wav"])
|
|
||||||
const wavData = await ffmpeg.readFile("output.wav")
|
|
||||||
console.log(wavData);
|
|
||||||
const wavBlob = new Blob([wavData], { type: "audio/wav" })
|
|
||||||
audioRef.current = URL.createObjectURL(wavBlob)
|
|
||||||
return wavBlob
|
|
||||||
}
|
|
||||||
|
|
||||||
const stopRecording = () => {
|
const stopRecording = () => {
|
||||||
mediaRecorderRef.current?.stop()
|
mediaRecorderRef.current?.stop()
|
||||||
setIsRecording(false)
|
setIsRecording(false)
|
||||||
|
|
Loading…
Reference in a new issue