Coder Social home page Coder Social logo

Comments (3)

bert2 avatar bert2 commented on August 21, 2024

Hi, thanks for the report! Could you provide me with the WAV file you are trying?

from dtmfdetection.

rwil02 avatar rwil02 commented on August 21, 2024

testwav.zip
Here's the "decode" loop for the received bytes:

for (int index = offset; index < sample.Length; index++)
{
	short pcm = MuLawDecoder.MuLawToLinearSample(sample[index]);
	byte[] pcmSample = {(byte) (pcm & 0xFF), (byte) (pcm >> 8)};
	m_WaveInEvent.RaiseDataAvailable(pcmSample);
}

Here's the "encode" loop for the sent bytes:

byte[] sample = new byte[sampleRaw.Length/2];
int sampleIndex = 0;

for (int index = 0; index < sampleRaw.Length; index += 2)
{
	byte ulawByte = MuLawEncoder.LinearToMuLawSample(BitConverter.ToInt16(sampleRaw, index));
	sample[sampleIndex++] = ulawByte;
}

from dtmfdetection.

bert2 avatar bert2 commented on August 21, 2024

That does not appear to be a problem with the DtmfDetection library but rather with your decoding/encoding step.

When I feed it to the DtmfDetector test program all DMTF tones are detected correctly:

PS> .\DtmfDetector.exe C:\Users\bert\Desktop\test.wav
00.051 s (0): One key (duration: 00.103 s)
00.231 s (0): Two key (duration: 00.102 s)
00.410 s (0): Three key (duration: 00.103 s)
00.589 s (0): Four key (duration: 00.103 s)
00.769 s (0): Five key (duration: 00.102 s)
00.948 s (0): Six key (duration: 00.103 s)
01.128 s (0): Seven key (duration: 00.102 s)
01.307 s (0): Eight key (duration: 00.077 s)
01.486 s (0): Nine key (duration: 00.103 s)
01.691 s (0): Zero key (duration: 00.103 s)
01.871 s (0): Hash key (duration: 00.102 s)
02.076 s (0): Star key (duration: 00.077 s)

Here is a screenshot of test.wav loaded in Audacity for comparison:

image

I'm afraid you will have to try your luck on Stack Overflow.

from dtmfdetection.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.