New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@solid-primitives/audio

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solid-primitives/audio

Primitives to manage audio and single sounds.

  • 1.1.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1K
increased by237.58%
Maintainers
2
Weekly downloads
 
Created
Source

@solid-primitives/audio

lerna size size

Primitive to manage audio playback in the browser. The primitives are easily composable and extended. To create your own audio element, consider using createAudioPlayer which allows you to supply a player instance that matches the built-in standard Audio API.

Each primitive also exposes the audio instance for further custom extensions. Within an SSR context this audio primitive performs noops but never interrupts the process. Time values and durations are zero'd and in LOADING state.

Installation

npm install @solid-primitives/audio
# or
yarn add @solid-primitives/audio

How to use it

createAudioPlayer

A foundational primitive with no player controls but exposes the raw player object.

const { player } = createAudioPlayer("example.wav");

createAudio

Provides a very basic interface for wrapping listeners to a supplied or default audio player.

const { play, pause } = createAudio("example.wav");

createAudioManager

Creates a very basic audio/sound player.

const { play, pause, duration, currentTime, seek, setVolume } = createAudioManager("example.wav");

Demo

You may view a working example here: https://codesandbox.io/s/solid-primitives-audio-5c9f3

Changelog

Expand Changelog

0.0.100

Pulling an early release of the package together and preparing for 1.0.0 release. No changes.

1.0.0

Minor clean-up, added tests and released.

1.0.1

Added testing and support for srcObject.

1.1.6

Added proper SSR and CJS support.

Keywords

FAQs

Package last updated on 04 Dec 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc