Socket
Socket
Sign inDemoInstall

electron-audio-conversion

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-audio-conversion

A promise-based library for loading audio files into HTML5 audio element in Electron. Uses the dataurl, id3 and mp3duration libraries.


Version published
Maintainers
1
Created
Source

electron-audio-conversion

A promise-based library for loading audio files into HTML5 audio. Uses the dataurl, id3 and mp3duration libraries.

Installation

npm install electron-audio-conversion

Usage

This library comes with 4 functions:

getSongDuration(filePath) -- Takes a filepath and returns the duration of that song.

getSongTags(track) -- Takes a track and returns the title, album and artist for that track.

createSongObject(filePath) -- Takes a filepath, creates a new object, calls getSongDuration and getSongTags and returns a promise with a song object that has the track, title, album and artist.

createSongUri(filePath, mimetype) -- Takes a filepath and creates a dataUri for that file. This dataUri is handed over to the HTML5 audio element to play the song.

In practice you'll likely only ever need createSongObject and createSongUri but you have access to the others if you need them.

Why?

This library makes it easier to pull audio files from the local file system and play them in the browser. We built this library to help with an Electron audio-player app and needed a way to create a playlist of song objects and then be able to make dataurl's on the fly for those songs as they're played.

Keywords

FAQs

Package last updated on 23 Jan 2017

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