Share via


RecordAudioActivity.RecordedFilePath Property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Gets the path to the recorded file, including the directory and name.

Namespace: Microsoft.SpeechServer.Dialog
Assembly: Microsoft.SpeechServer (in microsoft.speechserver.dll)

Syntax

'Declaration
<GlobalizedCategoryAttribute("NonDesignableCategory")> _
<GlobalizedDescriptionAttribute("RecordingCommon_RecordedFilePath")> _
<TypeConverterAttribute("Microsoft.SpeechServer.Authoring.DialogDesigner.NonDesignableStringConverter, Microsoft.SpeechServer.Authoring.DialogDesigner, Version=2.0.3400.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")> _
<ReadOnlyAttribute(True)> _
Public Property RecordedFilePath As String
[GlobalizedCategoryAttribute("NonDesignableCategory")] 
[GlobalizedDescriptionAttribute("RecordingCommon_RecordedFilePath")] 
[TypeConverterAttribute("Microsoft.SpeechServer.Authoring.DialogDesigner.NonDesignableStringConverter, Microsoft.SpeechServer.Authoring.DialogDesigner, Version=2.0.3400.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")] 
[ReadOnlyAttribute(true)] 
public string RecordedFilePath { get; }

Property Value

The path to the recorded file, including the directory and name.

Example

The following example shows an event handler for the TurnStarting event. In the try block, if the call to GetTempFileName succeeds in producing a non-null value for messageStorageLocation, the value in RecordedFilePath is copied to messageStorageLocation, overwriting any value that might already be there. Otherwise, the method logs an application error and throws an exception.

The purpose of the catch blocks is to catch exceptions that are thrown elsewhere than from the else clause of the try block.

private void GotIt_TurnStarting(object sender, TurnStartingEventArgs e)
{
  try
  {
    //
    // Save the message to the proper storage location
    //
    String messageStorageLocation = System.IO.Path.GetTempFileName();
    if (null != messageStorageLocation)
    {
      File.Copy(RecordAudio.RecordedFilePath, messageStorageLocation,
                true);
    }
    else
    {
      String errorMessage = "No storage is available for saving message";
      TelephonySession.LoggingManager.LogApplicationError(100, errorMessage);
      throw new UnexpectedRecordAudioException(errorMessage);
    }
  }
  catch (FileNotFoundException ex)
  {
    throw new FileManagementRecordAudioException(ex.Message,
          ex.InnerException);
  }
  catch (DirectoryNotFoundException ex)
  {
    throw new FileManagementRecordAudioException(ex.Message,
          ex.InnerException);
  }
  catch (UnauthorizedAccessException ex)
  {
    throw new FileManagementRecordAudioException(ex.Message,
          ex.InnerException);
  }
  catch (Exception ex)
  {
    throw new UnexpectedRecordAudioException(ex.Message,
          ex.InnerException);
  }
}

Thread Safety

All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.

Platforms

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

Windows Server 2003

See Also

Reference

RecordAudioActivity Class
RecordAudioActivity Members
Microsoft.SpeechServer.Dialog Namespace