refactor: centralize common strings, paths, and default values into a new Constants class.
This commit is contained in:
@@ -9,7 +9,7 @@ namespace Toak.Audio;
|
||||
|
||||
public class AudioRecorder : IAudioRecorder
|
||||
{
|
||||
private readonly string WavPath = Path.Combine(Path.GetTempPath(), "toak_recording.wav");
|
||||
private readonly string WavPath = Constants.Paths.RecordingWavFile;
|
||||
private readonly IRecordingStateTracker _stateTracker;
|
||||
private readonly INotifications _notifications;
|
||||
|
||||
@@ -33,7 +33,7 @@ public class AudioRecorder : IAudioRecorder
|
||||
|
||||
var pInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = "pw-record",
|
||||
FileName = Constants.Commands.AudioRecord,
|
||||
Arguments = $"--rate=16000 --channels=1 --format=s16 \"{WavPath}\"",
|
||||
UseShellExecute = false,
|
||||
CreateNoWindow = true,
|
||||
@@ -63,7 +63,7 @@ public class AudioRecorder : IAudioRecorder
|
||||
// Gracefully stop pw-record using SIGINT to ensure WAV headers are finalizing cleanly
|
||||
Process.Start(new ProcessStartInfo
|
||||
{
|
||||
FileName = "kill",
|
||||
FileName = Constants.Commands.ProcessKill,
|
||||
Arguments = $"-INT {pid.Value}",
|
||||
CreateNoWindow = true,
|
||||
UseShellExecute = false
|
||||
|
||||
Reference in New Issue
Block a user