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

linux-dtmf

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

linux-dtmf

DTFM decoder based on sox and multimon

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

linux-DTMF decoder

DTMF decoder based on multimon and SoX.

Dependencies

This module requires installed multimon, Sox. For decodign mp3 files/streams, you can install libsox-fmt-mp3

For Ubuntu, Debian and Debian-based dist:

apt install multimon sox libsox-fmt-mp3

Usage

See demo.js in demo folder

File decoding

Supports wav, ogg and raw from scratch. MP3 supported with libsox-fmt-mp3


const LDTMF = require('linux-dtmf');
const dtmf = new LDTMF();

let decodeResult = await dtmf.decodeUri('1234567890.wav', 'wav', true);
console.log('Decode result', decodeResult);

Buffer decoding


const LDTMF = require('linux-dtmf');
const dtmf = new LDTMF();

let dataBuffer = fs.readFileSync('1234567890.wav');

let decodeResult = await dtmf.decodeBuffer(dataBuffer, 'wav', true);
console.log('Decode result', decodeResult);

Stream decoding


const LDTMF = require('linux-dtmf');
const dtmf = new LDTMF();

let dataBuffer = fs.readFileSync('1234567890.wav');

dtmf.on('data', function (data) {
    console.log('Decoded data:', data);
});

dtmf.on('end', function () {
    console.log('Decode ended')
});

//Decode stream
let buffer = await dtmf.createDecodeBuffer('wav');
buffer.write(dataBuffer);

Events

LDTMF is an event based module.

.on('data', (data)=>{})

Decoded data

.on('end', ()=>{})

Decoder stopped

Keywords

dtmf

FAQs

Package last updated on 11 Mar 2019

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