是否有包含字母和标准数值的 DTMF API 或标准?

发布于 2024-07-17 12:18:59 字数 1542 浏览 6 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

世俗缘 2024-07-24 12:18:59

下面的函数将在 Java 中生成 16 位、有符号、线性 PCM、DTMF 音调。

public byte[] generateTone(float a, float b)
{
    byte samples[] = new byte[16000];    // Tone data buffer.
    int frames = samples.length / 2;     // Number of frames that fit in the buffer.

    /* Fill the buffer with the tone data. */
    for(int i = 0; i < frames; i++)
    {
        /* The 8000 value is the sample rate. */
        short value = (short)(32768 + 63 * Math.sin(i * 2 * Math.PI * a / 8000) + 63 * Math.sin(i * 2 * Math.PI * b / 8000));
        samples[i + i] = (byte)(value >>> 8);
        samples[i + (i + 1)] = (byte)value;
    }

    return samples;
}

我希望这会有所帮助...只需将两个频率作为参数 a 和 b 插入,您就会得到一个音调。 例如,第一名将生成为:

byte tone[] = generateTone(697, 1209);

Well the following function will generate a 16-bit, signed, linear PCM, DTMF tone in Java.

public byte[] generateTone(float a, float b)
{
    byte samples[] = new byte[16000];    // Tone data buffer.
    int frames = samples.length / 2;     // Number of frames that fit in the buffer.

    /* Fill the buffer with the tone data. */
    for(int i = 0; i < frames; i++)
    {
        /* The 8000 value is the sample rate. */
        short value = (short)(32768 + 63 * Math.sin(i * 2 * Math.PI * a / 8000) + 63 * Math.sin(i * 2 * Math.PI * b / 8000));
        samples[i + i] = (byte)(value >>> 8);
        samples[i + (i + 1)] = (byte)value;
    }

    return samples;
}

I hope this helps... Just plug in the two frequencies as parameters a and b and out you get a tone. For example number one would be generated as:

byte tone[] = generateTone(697, 1209);
饭团 2024-07-24 12:18:59

DTMF 仅涵盖数字 09 和字母 #、*、A、B、C、D。 因此,如果您的问题是是否存在支持 D 后面字母的任何内容,那么答案是否定的。

DTMF only covers the digits 0 to 9 and letters #, *, A, B, C, and D. So if your question is does there exist anything that supports letters after D, then the answer is no.

偷得浮生 2024-07-24 12:18:59

“DTMF“触摸”音在 CCITT 第 VI 卷:电话切换和信令建议 Q.23 的一般建议:按钮式电话机的技术特性中定义。”。 本文档及其相关标准文档将告诉您有关 DTMF 音调的更多信息,超出您的想象。 "

此引述来自此处。该网页涵盖了所有基础知识。

"DTMF "Touch" Tones are defined in CCITT Volume VI: General Recommendations on Telephone Switching and Signalling Recommendation Q.23: Technical Features of Push-Button Telephone Sets.". This document and its related standard documents will tell you more than you would ever want to know about DTMF tones. "

This quote is from here. That webpage covers all the basics.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文