【问题标题】:android DTmf tone安卓 DTmf 音
【发布时间】:2013-10-18 09:26:08
【问题描述】:

我正在通过此代码发送 dtmf 音。

String number="tel:+962791212121,2,3,3";
Intent c1= new Intent(android.content.Intent.ACTION_CALL, Uri.parse(number));
startActivity(c1);

它像这样发送完美的 dtmf。 2+(2 秒延迟)+3+(2 秒延迟)+3.

但我想消除那 2 秒的延迟,或者我想控制该延迟。

如何控制(2 秒延迟)? 或者在通话过程中发送dtmf音的任何其他方法?

【问题讨论】:

    标签: android


    【解决方案1】:

    要删除延迟,请删除逗号。

    【讨论】:

    • 并假设如果我想添加 300 的延迟或任何小于 1 秒的延迟,我该怎么办?
    • 对不起,我不知道这是否可能。
    【解决方案2】:

    试试这个方法()。

    private void call(int profileid) {//call procedure logic 
            ProfileDo profile = adapter.getProfile(profileid);
            if (profile.getStepCount() == 0) {
                Toast.makeText(getApplicationContext(), "Please edit the profile and add atleast one value to make a call", 10000).show();
                return;}
                String call = "tel:";
            for (StepDO step : profile.getSteps()) {
                String value = URLEncoder.encode(step.getValue());
                int delay = step.getDelay();
                String pausesStr = "";
                for (int i = 0; i < delay / 2; i++) {
                    pausesStr += PhoneNumberUtils.PAUSE;
                }
                call += value + pausesStr;
            }
             startActivity(new Intent("android.intent.action.CALL", Uri.parse(call)));      
        }
    

    希望对你有所帮助。

    【讨论】:

      【解决方案3】:

      试试这个:

      Intent signalIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:12334566778"+","+","+"1"));
      startActivity(signalIntent);
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2010-11-26
        • 1970-01-01
        • 2015-05-19
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多