Socket
Socket
Sign inDemoInstall

r3f-equalizer

Package Overview
Dependencies
0
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    r3f-equalizer

r3f-equalizer is a 3d audio equalizer for React built using [@react-three/fiber](https://github.com/pmndrs/react-three-fiber).


Version published
Weekly downloads
14
increased by133.33%
Maintainers
1
Install size
34.2 kB
Created
Weekly downloads
 

Readme

Source

@react-three/fiber equalizer

r3f-equalizer is a 3d audio equalizer for React built using @react-three/fiber.

Quickstart

npm install r3f-equalizer

r3f-equalizer exports a component Equalizer (as default), this component receives the following properties:

  • amplitude (type: number) — the amplitude of the volume. Default: 1
  • audio (type: RefObject<HTMLMediaElement>) — the HTML element where the audio comes from
  • backgroundColor (type: string) — the color of the background. If it's an empty string, the background will be transparent. Default: ""
  • cubeSideLength (type: number) — the side length of the "dancing cubes". Default: 0.03
  • cubeSpacing (type: number) — the spacing between the cubes. Default: 4.5
  • cameraFov (type: number) — the FOV of the camera. Default: 45
  • cameraPosition (type: number[3]) — the position of the camera in the 3d space (which the center is [0, 0, 0]). Default: [0, 5, 15]
  • gridCols (type: number) — the number of columns of the "dancing cubes" grid. Default: 80
  • gridRows (type: number) — the number of rows of the "dancing cubes" grid. Default: 12
  • onCreatedCallback (type: function) — function called after the canvas is created. Default: () => {}

Example

import React, { useEffect, useRef } from "react"
import Equalizer from "r3f-equalizer"

function App() {
  const audioRef = useRef()

  return <>
    <audio ref={audioRef} src="..." />

    <Equalizer amplitude={5} audio={audioRef} />
  </>
}

FAQs

Last updated on 15 Nov 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc