Class RingTone
A ring tone for an incoming call, played on a speaker until disposed: two bursts of a two-tone chord, then a pause, repeated; for platforms without a ringtone of their own, such as desktops.
Implements
Inherited Members
Namespace: Uniform.Matrix.Audio
Assembly: Uniform.Matrix.Audio.dll
Syntax
public sealed class RingTone : IDisposable
Remarks
The speaker opens and closes on a thread-pool thread: WASAPI's objects made on a UI thread, a single-threaded COM apartment on Windows, fail on NAudio's playback thread.
Methods
| Edit this page View SourceDispose()
Stop ringing, once the speaker has opened if it is still opening.
Declaration
public void Dispose()
Sample(long)
Return the sample of the ring at index since the start, between -1 and 1: 0.4 s on, 0.2 s off, 0.4 s on, 2 s off.
Declaration
public static double Sample(long index)
Parameters
| Type | Name | Description |
|---|---|---|
| long | index |
Returns
| Type | Description |
|---|---|
| double |
Start(IAudioDevices?)
Start ringing on the speaker of devices, without waiting for it to open; a speaker that does not open rings silently rather than failing the call.
Declaration
public static RingTone Start(IAudioDevices? devices)
Parameters
| Type | Name | Description |
|---|---|---|
| IAudioDevices | devices |
Returns
| Type | Description |
|---|---|
| RingTone |
Events
| Edit this page View SourceFailed
Raised when the speaker fails to open or play, so the app can log why there is no ring.
Declaration
public static event Action<Exception>? Failed
Event Type
| Type | Description |
|---|---|
| Action<Exception> |