Annotation Pro API
Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | Events | List of all members
Audio Class Reference

An audio. More...

Inherits Component.

Public Member Functions

 Audio ()
 Default constructor. More...
 
 Audio (IContainer container)
 Constructor. More...
 
void Close ()
 Clears this object to its blank/initial state. More...
 
void Convert (int samplerate, int bits, int channels)
 Convert audio format More...
 
int GetValue (int index, int channel)
 Gets a value. More...
 
List< double[]> GetWindows (int startInSamples, int endInSamples, int channel, int windowSizeInMs, int stepInMs, bool normalized)
 Divides data from the given channel into windows (frames) More...
 
bool New (int seconds)
 Clears this object to its blank/initial state. More...
 
bool Open (string fileName)
 Opens the given file. More...
 
void Play ()
 Plays this object. More...
 
void PlayStop ()
 Play stop. More...
 
void SaveSubWave (string waveFilePath, int start, int end)
 Saves a sub wave. More...
 
void Stop ()
 Stops this object. More...
 

Static Public Member Functions

static int ReadWaveSamplesCount (string audioFilePath)
 Reads wave samples count. More...
 

Protected Member Functions

override void Dispose (bool disposing)
 Clean up any resources being used. More...
 

Properties

bool AutoRewind = false [get, set]
 Gets or sets a value indicating whether the automatic rewind. More...
 
int BitsPerSample [get]
 Gets or sets the bits per sample. More...
 
int Channels [get]
 Gets or sets channels count. More...
 
string FilePath [get]
 Gets the full pathname of the file. More...
 
bool IsPlaying = 0 [get]
 Gets a value indicating whether this object is playing. More...
 
bool IsRecording = false [get]
 Gets a value indicating whether this object is playing. More...
 
bool IsSound [get]
 Gets a value indicating whether this object is sound. More...
 
bool Loop = true [get, set]
 Gets or sets a value indicating whether the loop playback. More...
 
int Maximum [get]
 Gets the maximum. More...
 
int Samplerate [get, set]
 Gets or sets the samplerate. More...
 
int SamplesCount [get]
 Gets the number of samples. More...
 
float SelectionEnd = 0 [get, set]
 Gets or sets the selection end. More...
 
float SelectionStart = "New Audio" [get, set]
 Gets or sets the selection start. More...
 
string SuggestedFileName = string.Empty [get, set]
 Suggested name in SaveFileDialog More...
 
string WaveFormat [get]
 Gets the wave format. More...
 

Events

AudioChangedHandler AudioChanged
 Event queue for all listeners interested in StartViewPositionChanged events. More...
 
CursorPositionChangedHandler CursorPositionChanged
 Event queue for all listeners interested in CursorPositionChanged events. More...
 
ModifiedHandler Modified
 Event queue for all listeners interested in Modified events. More...
 
PlaybackStartedHandler PlaybackStarted
 Event queue for all listeners interested in PlaybackStarted events. More...
 
PlaybackStoppedHandler PlaybackStopped
 Event queue for all listeners interested in PlaybackStopped events. More...
 
RecordingStartedHandler RecordingStarted
 Event queue for all listeners interested in RecordingStarted events. More...
 

Detailed Description

An audio.

Constructor & Destructor Documentation

◆ Audio() [1/2]

Audio ( )
inline

Default constructor.

◆ Audio() [2/2]

Audio ( IContainer  container)
inline

Constructor.

Parameters
containerThe container.

Member Function Documentation

◆ Close()

void Close ( )
inline

Clears this object to its blank/initial state.

◆ Convert()

void Convert ( int  samplerate,
int  bits,
int  channels 
)
inline

Convert audio format

Parameters
samplerateSamplerate
bitsBits per sample
channelsChannels

◆ Dispose()

override void Dispose ( bool  disposing)
inlineprotected

Clean up any resources being used.

Parameters
disposingtrue if managed resources should be disposed; otherwise, false.

◆ GetValue()

int GetValue ( int  index,
int  channel 
)
inline

Gets a value.

Parameters
indexZero-based index of the.
channelThe channel.
Returns
The value.

◆ GetWindows()

List<double[]> GetWindows ( int  startInSamples,
int  endInSamples,
int  channel,
int  windowSizeInMs,
int  stepInMs,
bool  normalized 
)
inline

Divides data from the given channel into windows (frames)

◆ New()

bool New ( int  seconds)
inline

Clears this object to its blank/initial state.

◆ Open()

bool Open ( string  fileName)
inline

Opens the given file.

Parameters
fileNameFilename of the file.

◆ Play()

void Play ( )
inline

Plays this object.

◆ PlayStop()

void PlayStop ( )
inline

Play stop.

◆ ReadWaveSamplesCount()

static int ReadWaveSamplesCount ( string  audioFilePath)
inlinestatic

Reads wave samples count.

Parameters
audioFilePathFull pathname of the audio file.
Returns
The wave samples count.

◆ SaveSubWave()

void SaveSubWave ( string  waveFilePath,
int  start,
int  end 
)
inline

Saves a sub wave.

Parameters
waveFilePathFull pathname of the wave file.
startThe start.
endThe end.

◆ Stop()

void Stop ( )
inline

Stops this object.

Property Documentation

◆ AutoRewind

bool AutoRewind = false
getset

Gets or sets a value indicating whether the automatic rewind.

true if automatic rewind, false if not.

◆ BitsPerSample

int BitsPerSample
get

Gets or sets the bits per sample.

The samplerate.

◆ Channels

int Channels
get

Gets or sets channels count.

Channels count.

◆ FilePath

string FilePath
get

Gets the full pathname of the file.

The full pathname of the file.

◆ IsPlaying

bool IsPlaying = 0
get

Gets a value indicating whether this object is playing.

true if this object is playing, false if not.

◆ IsRecording

bool IsRecording = false
get

Gets a value indicating whether this object is playing.

true if this object is playing, false if not.

◆ IsSound

bool IsSound
get

Gets a value indicating whether this object is sound.

true if this object is sound, false if not.

◆ Loop

bool Loop = true
getset

Gets or sets a value indicating whether the loop playback.

true if loop playback, false if not.

◆ Maximum

int Maximum
get

Gets the maximum.

The maximum value.

◆ Samplerate

int Samplerate
getset

Gets or sets the samplerate.

The samplerate.

◆ SamplesCount

int SamplesCount
get

Gets the number of samples.

The number of samples.

◆ SelectionEnd

float SelectionEnd = 0
getset

Gets or sets the selection end.

The selection end.

◆ SelectionStart

float SelectionStart = "New Audio"
getset

Gets or sets the selection start.

The selection start.

◆ SuggestedFileName

string SuggestedFileName = string.Empty
getset

Suggested name in SaveFileDialog

◆ WaveFormat

string WaveFormat
get

Gets the wave format.

The wave format.

Event Documentation

◆ AudioChanged

AudioChangedHandler AudioChanged

Event queue for all listeners interested in StartViewPositionChanged events.

Event queue for all listeners interested in ZoomFactorXChanged events.

Event queue for all listeners interested in AudioSelectionChanged events.

Event queue for all listeners interested in AudioChanged events.

◆ CursorPositionChanged

CursorPositionChangedHandler CursorPositionChanged

Event queue for all listeners interested in CursorPositionChanged events.

◆ Modified

ModifiedHandler Modified

Event queue for all listeners interested in Modified events.

◆ PlaybackStarted

PlaybackStartedHandler PlaybackStarted

Event queue for all listeners interested in PlaybackStarted events.

◆ PlaybackStopped

PlaybackStoppedHandler PlaybackStopped

Event queue for all listeners interested in PlaybackStopped events.

◆ RecordingStarted

RecordingStartedHandler RecordingStarted

Event queue for all listeners interested in RecordingStarted events.


The documentation for this class was generated from the following files: