forked from React-Group/interstellar_ai
installed axios
This commit is contained in:
parent
1a322bca8a
commit
ef2e40ca4a
4 changed files with 142 additions and 0 deletions
39
app/AudioRecorder(not yet).tsx
Normal file
39
app/AudioRecorder(not yet).tsx
Normal file
|
@ -0,0 +1,39 @@
|
|||
// import React, { useState, useRef } from 'react'
|
||||
|
||||
// const AudioRecorder: React.FC = () => {
|
||||
// const [isRecording, setIsRecording] = useState(false)
|
||||
// const [audioURL, setAudioURL] = useState<string | null>(null)
|
||||
// const medaRecorderRef = useRef<MediaRecorder | null>(null)
|
||||
// const audioChunks = useRef<Blob[]>([])
|
||||
|
||||
// const startRecording = async () => {
|
||||
// const stream = await navigator.mediaDevices.getUserMedia({ audio: true })
|
||||
// const mediaRecorder = new MediaRecorder(stream)
|
||||
// medaRecorderRef.current = mediaRecorder
|
||||
|
||||
// mediaRecorder.ondataavailable = (event) => {
|
||||
// audioChunks.current.push(event.data)
|
||||
// }
|
||||
|
||||
// mediaRecorder.onstop = () => {
|
||||
// const audioBlob = new Blob(audioChunks.current, { type: "audio/wav" })
|
||||
// const url = URL.createObjectURL(audioBlob)
|
||||
// setAudioURL(url)
|
||||
// audioChunks.current = []
|
||||
// }
|
||||
|
||||
// mediaRecorder.start()
|
||||
// setIsRecording(true)
|
||||
|
||||
// const stopRecording = () => {
|
||||
// medaRecorderRef.current?.stop()
|
||||
// setIsRecording(false)
|
||||
// }
|
||||
|
||||
// return (
|
||||
// <div></div>
|
||||
// )
|
||||
// }
|
||||
// }
|
||||
|
||||
// export default AudioRecorder
|
2
app/ProcessAPI.tsx
Normal file
2
app/ProcessAPI.tsx
Normal file
|
@ -0,0 +1,2 @@
|
|||
import React from "react";
|
||||
import axios from 'axios';
|
Loading…
Add table
Add a link
Reference in a new issue