Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.
/ dtmf.js Public archive

DTMF Tone Generator and Receiver

License

Notifications You must be signed in to change notification settings

meefik/dtmf.js

Repository files navigation

DTMF Tone Generator and Receiver

Library for sending and receive DTMF codes.

Usage

Receiver

var receiver = new DTMF.Receiver({ duration: 100, step: 10 });

// for capture an audio you need to use localhost or HTTPS
navigator.getUserMedia({
  audio: true
}, function(stream) {
  receiver.start(stream, function(char) {
    console.log(char);
  });
}, function(e) {
  alert('Cannot access audio stream.');
  console.log(e);
});

// for stop listening
// receiver.stop();

Sender

var sender = new DTMF.Sender({ duration: 100, pause: 40 });
sender.play('1234567890ABCD#*');

// for destroy sender instance
// sender.destroy();

See this video: https://youtu.be/OS6yIiq_Cp8

About

DTMF Tone Generator and Receiver

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published