I have created a Skype bot using the record action as defined in https://docs.botframework.com/en-us/skype/calling/#calling-conversation-object-model to record audio from the user, and then perform speech-to-text with the Bing speech recognition API after the recording has been completed using the soundfile.
private async Task OnRecordCompleted(RecordOutcomeEvent recordOutcomeEvent)
{
string s = string.Empty;
string path = string.Empty;
if (recordOutcomeEvent.RecordOutcome.Outcome = Outcome.Success)
{
var record = await recordOutcomeEvent.RecordedContent;
path = HttpContext.Current.Server.MapPath($"~/{recordOutcomeEvent.RecordOutcome.Id}.wav");
using (var writer = new FileStream(path, FileMode.Create))
{
await record.CopyToAsync(writer);
}
Attachment att = new Attachment()
{
ContentUrl = "file:///" + path,
ContentType = "audio/wav",
};
s = DoSpeechReco(att);