New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

audiograb

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

audiograb

A simple audio grabber for windows, linux, mac, and raspberry pi

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
3
-25%
Maintainers
0
Weekly downloads
 
Created
Source

A simple audio grabber for windows, linux, mac, and raspberry pi.

Discord Buy Me A Coffee

Installation

Using npm:

$ npm install audiograb

Other Installations:

$ yarn add audiograb
$ pnpm add audiograb

Usage

import { Recorder, EventType } from 'audiograb';
import fs from 'fs';

const recorder = new Recorder({
    '-i': 'Microphone (5- USB PnP Sound Device)',
}).setFormat('dshow');

// Create a `WriteStream` to save the audio data to a temporary file
const outputFilePath = './output.mp3';
const outputFile = fs.createWriteStream(outputFilePath);

// When recording starts
recorder.on('recordStarted', () => {
    console.log('Recording started...');
});

// Write audio data to the file as it arrives
recorder.on('audioData', (data) => {
    outputFile.write(data);
});

// When recording stops or an error occurs
recorder.on('recordStopped', () => {
    console.log('Recording stopped.');
    outputFile.end(); // Close the file stream
});

recorder.on('ffmpegInformation', (info) => {
    console.error('FFmpeg:', info);
});

// Start recording
recorder.start();

// Stop recording after a certain period
setTimeout(() => {
    recorder.stop();
}, 10000); // Stop recording after 10 seconds

License

audiograb is licensed under the GPL 3.0 License. See the LICENSE file for details.

Support

Discord Banner

Keywords

audio

FAQs

Package last updated on 14 Sep 2024

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