
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
dtmf-detection-stream
Advanced tools
This is a simple node.js DTMF detection stream.
npm i dtmf-detection-stream
const { ToneStream } = require('tone-stream')
const Speaker = require('speaker')
const DtmfDetectionStream = require('dtmf-detection-stream')
const format = {
sampleRate: 8000,
bitDepth: 16,
channels: 1,
}
const ts = new ToneStream(format)
ts.add([800, 's']) // silence
ts.add([800, 'DTMF:1'])
ts.add([800, 's']) // silence
ts.add([800, 'DTMF:2'])
ts.add([800, 's']) // silence
ts.add([800, 'DTMF:3'])
ts.add([800, 's']) // silence
const dds = new DtmfDetectionStream({format})
dds.on('dtmf', data => {
console.log('Got dtmf:', data)
})
dds.on('speech', data => {
console.log('Got speech:', data)
process.exit(0)
})
ts.on('data', data => {
dds.write(data)
})
const speaker = new Speaker(format)
ts.pipe(speaker)
Output:
$ node mytest.js
Got dtmf: { digit: '1', timestamp: 0.207 }
Got dtmf: { digit: '2', timestamp: 0.4025 }
Got dtmf: { digit: '3', timestamp: 0.6095 }
Got speech: { transcript: '123', timestamp: 0.6095 }
The DtmfDetectionStream emits two kinds of events:
See here.
FAQs
This is a simple node.js DTMF detection stream.
The npm package dtmf-detection-stream receives a total of 11 weekly downloads. As such, dtmf-detection-stream popularity was classified as not popular.
We found that dtmf-detection-stream 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 now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.