Class TonePlayer

Definition

Namespace:
Tizen.Multimedia
Assembly:
Tizen.Multimedia.AudioIO.dll
API Level:
3

Provides the ability to play a tone.

C#
Copy
public static class TonePlayer
Inheritance
System.Object
TonePlayer

Methods

View Source

StartAsync(ToneType, AudioStreamPolicy, Int32)

Plays a tone, asynchronously.

Declaration
C#
Copy
public static Task StartAsync(ToneType tone, AudioStreamPolicy streamPolicy, int durationMilliseconds)
Parameters
Type Name Description
ToneType tone

A ToneType to play.

AudioStreamPolicy streamPolicy

A AudioStreamPolicy.

Int32 durationMilliseconds

The tone duration in milliseconds. -1 indicates an infinite duration.

Returns
Type Description
System.Threading.Tasks.Task

A task that represents the asynchronous operation.

Exceptions
Type Condition
System.ArgumentException

tone is invalid.

System.ArgumentNullException

streamPolicy is null.

System.ArgumentOutOfRangeException

durationMilliseconds is less than -1.

System.InvalidOperationException

Any invalid operations occurred.

System.NotSupportedException

tone is not a supported type.

ObjectDisposedException

streamPolicy has already been disposed of.

API Level: 3
View Source

StartAsync(ToneType, AudioStreamPolicy, Int32, CancellationToken)

Plays a tone, asynchronously.

Declaration
C#
Copy
public static Task StartAsync(ToneType tone, AudioStreamPolicy streamPolicy, int durationMilliseconds, CancellationToken cancellationToken)
Parameters
Type Name Description
ToneType tone

A ToneType to play.

AudioStreamPolicy streamPolicy

A AudioStreamPolicy.

Int32 durationMilliseconds

The tone duration in milliseconds. -1 indicates an infinite duration.

System.Threading.CancellationToken cancellationToken

The cancellation token which can be used to stop playing the tone.

Returns
Type Description
System.Threading.Tasks.Task

A task that represents the asynchronous operation.

Exceptions
Type Condition
System.ArgumentException

tone is invalid.

System.ArgumentNullException

streamPolicy is null.

System.ArgumentOutOfRangeException

durationMilliseconds is less than -1.

System.InvalidOperationException

Any invalid operations occurred.

System.NotSupportedException

tone is not a supported type.

ObjectDisposedException

streamPolicy has already been disposed of.

API Level: 3