
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
react-sound
Advanced tools
Sound component to play audio in your web apps. Backed by the mighty soundmanager2 library.
// In your React component:
render() {
return (
<Sound
url="cool_sound.mp3"
playStatus={Sound.status.PLAYING}
playFromPosition={300 /* in milliseconds */}
onLoading={this.handleSongLoading}
onPlaying={this.handleSongPlaying}
onFinishedPlaying={this.handleSongFinishedPlaying}
/>
);
}
Yes! It's really easy to use sounds in your app as part of the component tree in your React app.
PLAYING status.npm install react-sound --save
var React = require('react');
var Sound = require('react-sound').default;
// ... or using import:
import React from 'react';
import Sound from 'react-sound';
class MyComponentWithSound extends React.Component {
render() {
return <Sound {...props} />; // Check props in next section
}
}
Note: By default, a restriction on mobile prevent you from playing multiple sounds. To avoid this, you need to set the ignoreMobileRestrictions property to true when setting up soundManager2.
playStatus is not PLAYING). Use this prop to seek to different positions in the sound, but not use it as a controlled component. You should use either this prop or position, but not both.onPlaying callback. You should use either this prop or playFromPosition, but not both.false).false).errorCode and description with details about the error.bytesLoaded, bytesTotal and duration.loaded, a boolean set to true if the sound has finished loading successfully.position and duration.position and duration.position and duration.position and duration.Feel free to fork and send PRs or issues, be it for features, bug fixes, or documentation!
FAQs
React Sound component using soundmanager2
The npm package react-sound receives a total of 6,163 weekly downloads. As such, react-sound popularity was classified as popular.
We found that react-sound demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.