Skip to content

Nerimity/solid-opus-media-recorder

Repository files navigation

@nerimity/solid-opus-media-recorder

@nerimity/solid-opus-media-recorder

pnpm

Opus ogg mic recorder to blob

Quick start

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

Important

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published