本文整理汇总了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());
}
示例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());
}
示例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());
}
示例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());
}
示例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);
}