Class AudioTestViewModel
The audio test: plays the microphone back a second later, through Opus as in a call, to try the microphone and the speaker or earpiece.
Inherited Members
Namespace: Uniform.Chat.Avalonia.ViewModels
Assembly: Uniform.Chat.Avalonia.dll
Syntax
public sealed class AudioTestViewModel : ViewModelBase, INotifyPropertyChanged, INotifyPropertyChanging, IDisposable
Constructors
| Edit this page View SourceAudioTestViewModel(Func<bool, IAudioDevices>, bool, Func<Task<bool>>?)
The audio test: plays the microphone back a second later, through Opus as in a call, to try the microphone and the speaker or earpiece.
Declaration
public AudioTestViewModel(Func<bool, IAudioDevices> audio, bool hasEarpiece, Func<Task<bool>>? requestMicrophone)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<bool, IAudioDevices> | audio | Opens the platform's devices, given whether to use the loudspeaker. |
| bool | hasEarpiece | Whether the loudspeaker is a choice, as on phones. |
| Func<Task<bool>> | requestMicrophone | Asks for the microphone permission where needed, or null. |
Properties
| Edit this page View SourceButtonText
Text of the start and stop button.
Declaration
public string ButtonText { get; }
Property Value
| Type | Description |
|---|---|
| string |
HasEarpiece
Whether the loudspeaker is a choice.
Declaration
public bool HasEarpiece { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsRunning
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("ButtonText")]
[ExcludeFromCodeCoverage]
public bool IsRunning { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Loudspeaker
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool Loudspeaker { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Status
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public string Status { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ToggleCommand
Gets an IAsyncRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.AudioTestViewModel.ToggleAsync().
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand ToggleCommand { get; }
Property Value
| Type | Description |
|---|---|
| IAsyncRelayCommand |
Methods
| Edit this page View SourceDispose()
Stop the test.
Declaration
public void Dispose()
Stop()
Stop the test and show what went through.
Declaration
public void Stop()