当前位置: 首页>>代码示例>>C#>>正文


C# Tropo.Record方法代码示例

本文整理汇总了C#中TropoCSharp.Tropo.Tropo.Record方法的典型用法代码示例。如果您正苦于以下问题:C# Tropo.Record方法的具体用法?C# Tropo.Record怎么用?C# Tropo.Record使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TropoCSharp.Tropo.Tropo的用法示例。


在下文中一共展示了Tropo.Record方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            // Create a new instance of the Tropo object.
            Tropo tropo = new Tropo();

            // Set the voice property.
            tropo.Voice = Voice.UsEnglishMale;

            Say say = new Say("Please record your 45 second message after the beep, press pound when complete.");

            tropo.Say(say);

            Record record = new Record()
            {
                Bargein = true,
                Beep = true,
                Say = new Say(""),
                Format = "audio/mp3",
                MaxTime = 45,
                Choices = new Choices("", "dtmf", "#"),
                Url = "../UploadRecording"
            };

            tropo.Record(record);

            // Render JSON for Tropo to consume.
            Response.Write(tropo.RenderJSON());
        }
开发者ID:nSource,项目名称:tropo-webapi-csharp,代码行数:28,代码来源:AskTest.aspx.cs

示例2: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            // Create a new instance of the Tropo object.
            Tropo tropo = new Tropo();

            // Create a transcription object to use with recording.
            Transcription trancription = new Transcription();
            trancription.Uri = "mailto:[email protected]";
            trancription.EmailFormat = "omit";

            // Set up grammar for recording.
            Choices choices = new Choices();
            choices.Value = "[10 DIGITS]";
            choices.Terminator = "#";

            // Construct a prompt to use with the recording.
            Say say = new Say();
            say.Value = "Please say your account number";

            // Use the record() method to set up a recording.
            tropo.Record(3, false, true, choices, AudioFormat.Wav, 10, 60, Method.Post, null, true, say, 5, trancription, null, "http://somehost.com/record.aspx");

            // Hangup when finished.
            tropo.Hangup();
            
            // Render the JSON for Tropo to consume.
            Response.Write(tropo.RenderJSON());
        }
开发者ID:Shannon-McCoy,项目名称:tropo-webapi-csharp,代码行数:28,代码来源:RecordWithTranscription.aspx.cs

示例3: testRecordTranscription

        public void testRecordTranscription()
        {
            Say say = new Say("Please say your account number");
            Choices choices = new Choices("[5 DIGITS]", null, "#");
            Transcription transcription = new Transcription();

            transcription.Uri = "http://example.com/";
            transcription.Id = "foo";
            transcription.EmailFormat = "encoded";

            Tropo tropo = new Tropo();
            tropo.Record(1, false, true, choices, AudioFormat.Wav, 5, 30, Method.Post, "foo", true, say, 5, transcription, "bar", "http://example.com/");
            Assert.AreEqual(this.recordJsonWithTranscription, tropo.RenderJSON());
        }
开发者ID:nSource,项目名称:tropo-webapi-csharp,代码行数:14,代码来源:TropoClassesTests.cs

示例4: testNewRecordObjectWithOptionsInDifferentOrder

        public void testNewRecordObjectWithOptionsInDifferentOrder()
        {
            Say say = new Say("Please say your account number");
            Choices choices = new Choices("[5 DIGITS]", null, "#");
            Record record = new Record();
            record.Say = say;
            record.Method = Method.Post;
            record.Choices = choices;
            record.Format = AudioFormat.Wav;
            record.Required = true;

            Tropo tropo = new Tropo();
            tropo.Record(record);
            Assert.AreEqual(this.recordJson, tropo.RenderJSON());
        }
开发者ID:nSource,项目名称:tropo-webapi-csharp,代码行数:15,代码来源:TropoClassesTests.cs

示例5: testNewRecord

        public void testNewRecord()
        {
            Say say = new Say("Please say your account number");
            Choices choices = new Choices("[5 DIGITS]", null, "#");

            Tropo tropo = new Tropo();
            tropo.Record(null, null, null, choices, AudioFormat.Wav, null, null, Method.Post, null, null, say, null, null, null);
        }
开发者ID:nSource,项目名称:tropo-webapi-csharp,代码行数:8,代码来源:TropoClassesTests.cs


注:本文中的TropoCSharp.Tropo.Tropo.Record方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。