Plays the
AnnAudioObject object that is currently being edited (selected) in this
AnnAutomation.
Syntax
Visual Basic (Declaration) | |
---|
Public Overridable Sub PlayAudio() |
Visual Basic (Usage) | Copy Code |
---|
Dim instance As AnnAutomation
instance.PlayAudio()
|
C# | |
---|
public virtual void PlayAudio() |
Managed Extensions for C++ | |
---|
public: virtual void PlayAudio(); |
C++/CLI | |
---|
public:
virtual void PlayAudio(); |
Example
Visual Basic | Copy Code |
---|
Public Sub AnnAutomation_PlayAudio(ByVal automation As AnnAutomation, ByVal audioFilename As String)
automation.SelectNone()
If (Not automation.CanPlayAudio) Then
MessageBox.Show("Cannot play audio")
End If
Dim audio As AnnAudioObject = New AnnAudioObject()
audio.Bounds = New AnnRectangle(100, 100, 200, 200, AnnUnit.Pixel)
automation.Container.Objects.Add(audio)
automation.StartEditing(audio, False)
If (Not automation.CanPlayAudio) Then
MessageBox.Show("Cannot play audio")
End If
audio.FileName = audioFilename
If automation.CanPlayAudio Then
automation.PlayAudio()
End If
End Sub |
C# | Copy Code |
---|
public void AnnAutomation_PlayAudio(AnnAutomation automation, string audioFilename) { // make sure no objects are selected automation.SelectNone(); // see if we can play audio (should say no) if(!automation.CanPlayAudio) MessageBox.Show("Cannot play audio"); // add an audio object and select it AnnAudioObject audio = new AnnAudioObject(); audio.Bounds = new AnnRectangle(100, 100, 200, 200, AnnUnit.Pixel); automation.Container.Objects.Add(audio); automation.StartEditing(audio, false); // see if we can play audio // (should say no, since the audio object does not have an audio file in the filename yet) if(!automation.CanPlayAudio) MessageBox.Show("Cannot play audio"); // set up the filename for this audio object audio.FileName = audioFilename; // see if we can play audio (should play it now) if(automation.CanPlayAudio) automation.PlayAudio(); } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also