Opus ogg mic recorder to blob
Install it:
npm i @nerimity/solid-opus-media-recorder
# or
yarn add @nerimity/solid-opus-media-recorder
# or
pnpm add @nerimity/solid-opus-media-recorder
Before using this library, make sure to create a seperate init.ts
file and import it from your main/index.ts.
// init.ts
window.global ||= window;
// index/main.ts
import './init';
Use it:
import { useMicRecorder } from '@nerimity/solid-opus-media-recorder'
const App = () => {
const {record, stop} = useMicRecorder();
const onRecordClick = async () => {
console.log("recording...")
const blob = await record();
console.log("recorded", blob)
}
return (
<div>
<button onClick={onRecordClick}>Record</button>
<button onClick={stop}>Stop</button>
</div>
)
}
export default App