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
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.

System.Int32 durationMilliseconds

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

Returns
Type Description
Task

A task that represents the asynchronous operation.

Exceptions
Type Condition
System.ArgumentException

tone is invalid.

ArgumentNullException

streamPolicy is null.

ArgumentOutOfRangeException

durationMilliseconds is less than -1.

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.

System.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
Task

A task that represents the asynchronous operation.

Exceptions
Type Condition
System.ArgumentException

tone is invalid.

ArgumentNullException

streamPolicy is null.

ArgumentOutOfRangeException

durationMilliseconds is less than -1.

InvalidOperationException

Any invalid operations occurred.

System.NotSupportedException

tone is not a supported type.

ObjectDisposedException

streamPolicy has already been disposed of.

API Level: 3