Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

video-to-audio

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

video-to-audio

A lightweight video to audio conversion tool to convert mp4, avi and mov file to mp3, wav and aac file.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
207
decreased by-30.54%
Maintainers
1
Weekly downloads
 
Created
Source

video-to-audio

A lightweight video to audio conversion tool to convert mp4, avi and mov file to mp3, wav and aac file.

DEMO

Install
npm install video-to-audio

Usage

import VideoToAudio from 'video-to-audio'

VideoToAudio.convert(sourceVideoFile, targetAudioFormat);

Example Code

<input type='file' accept=".mp4, .avi, .mov" onchange="convertToAudio(this)" />

import VideoToAudio from 'video-to-audio'

async function convertToAudio(input) {
    let sourceVideoFile = input.files[0];
    let targetAudioFormat = 'mp3'
    let convertedAudioDataObj = await VideoToAudio.convert(sourceVideoFile, targetAudioFormat);
}
This convert function will return a converted audio data object which includes audio name, format and blob URL.
This blob URL can be used to download the converted audio.
function downloadAudio(convertedAudioDataObj) {
    let a = document.createElement("a");
    a.href = convertedAudioDataObj.data;
    a.download = convertedAudioDataObj.name + "." + convertedAudioDataObj.format;
    a.click();
}

License

MIT

Keywords

FAQs

Package last updated on 28 Apr 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