LEADTOOLS Annotations (Leadtools.Annotations assembly)
LEAD Technologies, Inc

PlayAudio Method

Example 





Plays the AnnAudioObject object that is currently being edited (selected) in this AnnAutomation.
Syntax
public virtual void PlayAudio()
'Declaration
 
Public Overridable Sub PlayAudio() 
'Usage
 
Dim instance As AnnAutomation
 
instance.PlayAudio()
public virtual void PlayAudio()
 function Leadtools.Annotations.AnnAutomation.PlayAudio()
public:
virtual void PlayAudio(); 
Remarks

AnnAutomation can play one or more AnnAudioObject if they are currently in edit mode (selected) and the value of the CanPlay property is true.

Use the CanPlayAudio property to determine whether you can call this method.

Example
 
Public Sub AnnAutomation_PlayAudio(ByVal automation As AnnAutomation, ByVal audioFilename As String)
   ' make sure no objects are selected
   automation.SelectNone()
   ' see if we can play audio (should say no)
   If (Not automation.CanPlayAudio) Then
      MessageBox.Show("Cannot play audio")
   End If

   ' add an audio object and select it
   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)

   ' see if we can play audio 
   ' (should say no, since the audio object does not have an audio file in the filename yet)
   If (Not automation.CanPlayAudio) Then
      MessageBox.Show("Cannot play audio")
   End If

   ' set up the filename for this audio object
   audio.FileName = audioFilename

   ' see if we can play audio (should play it now)
   If automation.CanPlayAudio Then
      automation.PlayAudio()
   End If
End Sub
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();
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

AnnAutomation Class
AnnAutomation Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.