Open MayamaTakeshi opened 2 months ago
This script:
const DtmfDetectionStream = require('./index.js') const DtmfGenerationStream = require('dtmf-generation-stream') const sampleRate = 8000 const format = { sampleRate, bitDepth: 16, channels: 1, } const params = { text: '0123456789', } const dgs = new DtmfGenerationStream({format, params}) const dds = new DtmfDetectionStream({format}) var intervalID = setInterval(() => { //console.log("interval") var bytes = (sampleRate / 8000) * 320 var data = dgs.read(bytes) //console.log(data) if(data) { dds.write(data) } else { setTimeout(() => { console.log("done") process.exit(0) }, 1000) } }, 20) dds.on('dtmf', data => { console.log('Event dtmf:', data) }) dds.on('speech', data => { console.log('Event speech:', data) clearInterval(intervalID) })
will not detect any dtmf tones. To make it work it is necessary to increase bytes to a large value (like * 30).
What is not clear to me is how we don't see any problems when using it with ws_speech_server.
This script:
will not detect any dtmf tones. To make it work it is necessary to increase bytes to a large value (like * 30).