neoagent 3.1.1-beta.9 → 3.2.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +2 -2
- package/README.md +5 -1
- package/docs/architecture.md +1 -1
- package/docs/benchmarking.md +68 -87
- package/docs/capabilities.md +1 -1
- package/docs/clients-and-devices.md +3 -4
- package/docs/configuration.md +1 -1
- package/docs/devices.md +1 -2
- package/docs/health.md +24 -0
- package/docs/index.md +2 -2
- package/docs/integrations-architecture.md +6 -0
- package/docs/integrations.md +15 -1
- package/docs/models.md +1 -1
- package/docs/persistence.md +1 -1
- package/docs/why-neoagent.md +1 -1
- package/flutter_app/README.md +0 -5
- package/flutter_app/android/app/src/main/AndroidManifest.xml +0 -14
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/MainActivity.kt +0 -98
- package/flutter_app/lib/main.dart +0 -6
- package/flutter_app/lib/main_app_shell.dart +0 -2
- package/flutter_app/lib/main_controller.dart +2 -867
- package/flutter_app/lib/main_devices.dart +0 -73
- package/flutter_app/lib/main_integrations.dart +339 -187
- package/flutter_app/lib/main_launcher.dart +2 -212
- package/flutter_app/lib/main_models.dart +0 -259
- package/flutter_app/lib/main_navigation.dart +2 -14
- package/flutter_app/lib/main_operations.dart +875 -383
- package/flutter_app/lib/main_runtime.dart +9 -208
- package/flutter_app/lib/main_settings.dart +17 -199
- package/flutter_app/lib/main_shared.dart +20 -591
- package/flutter_app/lib/main_timeline.dart +26 -122
- package/flutter_app/lib/main_voice_assistant.dart +0 -5
- package/flutter_app/lib/src/backend_client.dart +0 -102
- package/flutter_app/lib/src/desktop_companion_io.dart +1 -65
- package/flutter_app/lib/src/desktop_companion_stub.dart +0 -12
- package/flutter_app/linux/flutter/generated_plugin_registrant.cc +0 -4
- package/flutter_app/linux/flutter/generated_plugins.cmake +0 -1
- package/flutter_app/macos/Flutter/GeneratedPluginRegistrant.swift +0 -2
- package/flutter_app/macos/Podfile.lock +56 -5
- package/flutter_app/pubspec.lock +0 -7
- package/flutter_app/pubspec.yaml +0 -2
- package/flutter_app/web/index.html +174 -0
- package/flutter_app/windows/flutter/generated_plugin_registrant.cc +0 -3
- package/flutter_app/windows/flutter/generated_plugins.cmake +0 -1
- package/landing/index.html +0 -2
- package/lib/manager.js +1 -1
- package/lib/schema_migrations.js +75 -0
- package/package.json +1 -4
- package/server/db/database.js +1 -133
- package/server/http/middleware.js +2 -16
- package/server/http/routes.js +0 -2
- package/server/public/.last_build_id +1 -1
- package/server/public/assets/NOTICES +0 -25
- package/server/public/assets/fonts/MaterialIcons-Regular.otf +0 -0
- package/server/public/flutter_bootstrap.js +2 -2
- package/server/public/index.html +174 -0
- package/server/public/main.dart.js +92036 -91145
- package/server/routes/auth.js +11 -2
- package/server/routes/settings.js +0 -5
- package/server/routes/voice_assistant.js +1 -128
- package/server/services/account/erasure.js +0 -3
- package/server/services/ai/deliverables/artifact_helpers.js +1 -1
- package/server/services/ai/loop/conversation_loop.js +6 -2
- package/server/services/ai/loop/tool_dispatch.js +0 -3
- package/server/services/ai/messagingFallback.js +1 -1
- package/server/services/ai/settings.js +0 -6
- package/server/services/ai/toolEvidence.js +1 -4
- package/server/services/ai/tools.js +0 -234
- package/server/services/desktop/auth.js +0 -3
- package/server/services/desktop/registry.js +2 -50
- package/server/services/integrations/neoarchive/provider.js +616 -0
- package/server/services/integrations/neorecall/client.js +140 -0
- package/server/services/integrations/neorecall/constants.js +87 -0
- package/server/services/integrations/neorecall/provider.js +163 -0
- package/server/services/integrations/registry.js +4 -2
- package/server/services/manager.js +0 -22
- package/server/services/memory/manager.js +44 -19
- package/server/services/memory/retrieval_reasoning.js +36 -14
- package/server/services/messaging/formatting_guides.js +1 -0
- package/server/services/messaging/whatsapp.js +18 -0
- package/server/services/security/tool_categories.js +0 -5
- package/server/services/social_video/service.js +2 -20
- package/server/services/tasks/adapters/index.js +1 -1
- package/server/services/tasks/integration_runtime.js +3 -67
- package/server/services/tasks/runtime.js +1 -6
- package/server/services/tasks/task_repository.js +6 -13
- package/server/services/timeline/service.js +0 -224
- package/server/services/voice/message.js +0 -24
- package/server/services/voice/providers.js +42 -1
- package/server/services/voice/runtimeManager.js +9 -5
- package/server/services/voice/turnRunner.js +0 -22
- package/server/services/wearable/service.js +0 -5
- package/docs/recordings-and-health.md +0 -41
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/recording/RecordingBootReceiver.kt +0 -21
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/recording/RecordingForegroundService.kt +0 -586
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/recording/RecordingStateStore.kt +0 -78
- package/flutter_app/android/app/src/main/kotlin/com/neoagent/flutter_app/recording/RecordingUploadClient.kt +0 -104
- package/flutter_app/lib/main_recordings.dart +0 -920
- package/flutter_app/lib/src/desktop_ocr_bridge.dart +0 -2
- package/flutter_app/lib/src/desktop_ocr_bridge_io.dart +0 -125
- package/flutter_app/lib/src/desktop_ocr_bridge_stub.dart +0 -30
- package/flutter_app/lib/src/desktop_passive_history.dart +0 -332
- package/flutter_app/lib/src/recording_bridge.dart +0 -232
- package/flutter_app/lib/src/recording_bridge_io.dart +0 -1027
- package/flutter_app/lib/src/recording_bridge_stub.dart +0 -120
- package/flutter_app/lib/src/recording_bridge_web.dart +0 -702
- package/flutter_app/lib/src/recording_chunk_queue.dart +0 -149
- package/flutter_app/lib/src/recording_chunk_queue_io.dart +0 -182
- package/flutter_app/lib/src/recording_payloads.dart +0 -95
- package/flutter_app/third_party/desktop_audio_capture/LICENSE +0 -21
- package/flutter_app/third_party/desktop_audio_capture/README.md +0 -262
- package/flutter_app/third_party/desktop_audio_capture/lib/audio_capture.dart +0 -65
- package/flutter_app/third_party/desktop_audio_capture/lib/config/mic_audio_config.dart +0 -153
- package/flutter_app/third_party/desktop_audio_capture/lib/config/system_adudio_config.dart +0 -110
- package/flutter_app/third_party/desktop_audio_capture/lib/mic/mic_audio_capture.dart +0 -461
- package/flutter_app/third_party/desktop_audio_capture/lib/model/audio_status.dart +0 -91
- package/flutter_app/third_party/desktop_audio_capture/lib/model/decibel_data.dart +0 -106
- package/flutter_app/third_party/desktop_audio_capture/lib/model/input_device_type.dart +0 -219
- package/flutter_app/third_party/desktop_audio_capture/lib/system/system_audio_capture.dart +0 -336
- package/flutter_app/third_party/desktop_audio_capture/linux/CMakeLists.txt +0 -101
- package/flutter_app/third_party/desktop_audio_capture/linux/audio_capture_plugin.cc +0 -692
- package/flutter_app/third_party/desktop_audio_capture/linux/include/audio_capture/audio_capture_plugin.h +0 -35
- package/flutter_app/third_party/desktop_audio_capture/linux/include/audio_capture/mic_capture_plugin.h +0 -36
- package/flutter_app/third_party/desktop_audio_capture/linux/include/desktop_audio_capture/audio_capture_plugin.h +0 -32
- package/flutter_app/third_party/desktop_audio_capture/linux/include/desktop_audio_capture/mic_capture_plugin.h +0 -32
- package/flutter_app/third_party/desktop_audio_capture/linux/mic_capture_plugin.cc +0 -878
- package/flutter_app/third_party/desktop_audio_capture/macos/Classes/AudioCapturePlugin.swift +0 -27
- package/flutter_app/third_party/desktop_audio_capture/macos/Classes/MicCapturePlugin.swift +0 -1172
- package/flutter_app/third_party/desktop_audio_capture/macos/Classes/SystemCapturePlugin.swift +0 -655
- package/flutter_app/third_party/desktop_audio_capture/macos/Resources/PrivacyInfo.xcprivacy +0 -12
- package/flutter_app/third_party/desktop_audio_capture/macos/desktop_audio_capture.podspec +0 -30
- package/flutter_app/third_party/desktop_audio_capture/pubspec.yaml +0 -87
- package/flutter_app/third_party/desktop_audio_capture/windows/CMakeLists.txt +0 -105
- package/flutter_app/third_party/desktop_audio_capture/windows/audio_capture_plugin.cpp +0 -80
- package/flutter_app/third_party/desktop_audio_capture/windows/audio_capture_plugin.h +0 -31
- package/flutter_app/third_party/desktop_audio_capture/windows/audio_capture_plugin_c_api.cpp +0 -12
- package/flutter_app/third_party/desktop_audio_capture/windows/include/audio_capture/audio_capture_plugin_c_api.h +0 -23
- package/flutter_app/third_party/desktop_audio_capture/windows/include/desktop_audio_capture/audio_capture_plugin.h +0 -25
- package/flutter_app/third_party/desktop_audio_capture/windows/mic_capture_plugin.cpp +0 -1117
- package/flutter_app/third_party/desktop_audio_capture/windows/mic_capture_plugin.h +0 -115
- package/flutter_app/third_party/desktop_audio_capture/windows/system_audio_capture_plugin.cpp +0 -777
- package/flutter_app/third_party/desktop_audio_capture/windows/system_audio_capture_plugin.h +0 -87
- package/server/routes/recordings.js +0 -335
- package/server/routes/screenHistory.js +0 -190
- package/server/services/ai/recordingInsights.js +0 -105
- package/server/services/integrations/neomail/provider.js +0 -993
- package/server/services/recordings/deepgram.js +0 -58
- package/server/services/recordings/manager.js +0 -1273
- package/server/services/tasks/adapters/neomail_email_received.js +0 -46
- package/server/services/voice/screenshotContext.js +0 -73
- package/server/services/voice/turnCoordinator.js +0 -51
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
// You have generated a new plugin project without specifying the `--platforms`
|
|
2
|
-
// flag. A plugin project with no platform support was generated. To add a
|
|
3
|
-
// platform, run `flutter create -t plugin --platforms <platforms> .` under the
|
|
4
|
-
// same directory. You can also find a detailed instruction on how to add
|
|
5
|
-
// platforms in the `pubspec.yaml` at
|
|
6
|
-
// https://flutter.dev/to/pubspec-plugin-platforms.
|
|
7
|
-
|
|
8
|
-
export 'package:desktop_audio_capture/mic/mic_audio_capture.dart';
|
|
9
|
-
export 'package:desktop_audio_capture/system/system_audio_capture.dart';
|
|
10
|
-
|
|
11
|
-
// Re-export DecibelData from mic_audio_capture (both mic and system use the same class)
|
|
12
|
-
export 'package:desktop_audio_capture/model/decibel_data.dart';
|
|
13
|
-
export 'package:desktop_audio_capture/model/input_device_type.dart';
|
|
14
|
-
export 'package:desktop_audio_capture/model/audio_status.dart';
|
|
15
|
-
|
|
16
|
-
/// Abstract base class for audio capture functionality.
|
|
17
|
-
///
|
|
18
|
-
/// This class defines the common interface for capturing audio from different sources
|
|
19
|
-
/// (microphone or system audio). Implementations include [MicAudioCapture] and
|
|
20
|
-
/// [SystemAudioCapture].
|
|
21
|
-
///
|
|
22
|
-
/// Example:
|
|
23
|
-
/// ```dart
|
|
24
|
-
/// final audioCapture = MicAudioCapture();
|
|
25
|
-
/// await audioCapture.initialize();
|
|
26
|
-
/// await audioCapture.startCapture();
|
|
27
|
-
///
|
|
28
|
-
/// // Listen to audio stream
|
|
29
|
-
/// audioCapture.audioStream?.listen((audioData) {
|
|
30
|
-
/// // Process audio data
|
|
31
|
-
/// });
|
|
32
|
-
///
|
|
33
|
-
/// // Stop when done
|
|
34
|
-
/// await audioCapture.stopCapture();
|
|
35
|
-
/// await audioCapture.dispose();
|
|
36
|
-
/// ```
|
|
37
|
-
abstract class AudioCapture {
|
|
38
|
-
/// Whether the audio capture is currently recording.
|
|
39
|
-
///
|
|
40
|
-
/// Returns `true` if capture is active, `false` otherwise.
|
|
41
|
-
///
|
|
42
|
-
/// Example:
|
|
43
|
-
/// ```dart
|
|
44
|
-
/// if (audioCapture.isRecording) {
|
|
45
|
-
/// print('Audio capture is active');
|
|
46
|
-
/// }
|
|
47
|
-
/// ```
|
|
48
|
-
bool get isRecording;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/// Abstract base class for audio capture configuration.
|
|
52
|
-
///
|
|
53
|
-
/// This class defines the common interface for configuration objects used
|
|
54
|
-
/// to configure audio capture settings. Implementations include [MicAudioConfig]
|
|
55
|
-
/// and [SystemAudioConfig].
|
|
56
|
-
///
|
|
57
|
-
/// Example:
|
|
58
|
-
/// ```dart
|
|
59
|
-
/// final config = MicAudioConfig(
|
|
60
|
-
/// sampleRate: 44100,
|
|
61
|
-
/// channels: 2,
|
|
62
|
-
/// );
|
|
63
|
-
/// final capture = MicAudioCapture(config: config);
|
|
64
|
-
/// ```
|
|
65
|
-
abstract class AudioCaptureConfig {}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import 'package:desktop_audio_capture/audio_capture.dart';
|
|
2
|
-
|
|
3
|
-
/// Configuration class for microphone audio capture.
|
|
4
|
-
///
|
|
5
|
-
/// This class allows you to configure various audio capture parameters
|
|
6
|
-
/// such as sample rate, channels, bit depth, gain boost, and input volume.
|
|
7
|
-
///
|
|
8
|
-
/// Example:
|
|
9
|
-
/// ```dart
|
|
10
|
-
/// // Create with default values
|
|
11
|
-
/// final config = MicAudioConfig();
|
|
12
|
-
///
|
|
13
|
-
/// // Create with custom values
|
|
14
|
-
/// final customConfig = MicAudioConfig(
|
|
15
|
-
/// sampleRate: 44100,
|
|
16
|
-
/// channels: 2,
|
|
17
|
-
/// bitDepth: 24,
|
|
18
|
-
/// gainBoost: 3.0,
|
|
19
|
-
/// inputVolume: 0.8,
|
|
20
|
-
/// );
|
|
21
|
-
///
|
|
22
|
-
/// // Use with capture
|
|
23
|
-
/// final capture = MicAudioCapture(config: customConfig);
|
|
24
|
-
///
|
|
25
|
-
/// // Update configuration
|
|
26
|
-
/// final updatedConfig = customConfig.copyWith(
|
|
27
|
-
/// gainBoost: 2.5,
|
|
28
|
-
/// inputVolume: 1.0,
|
|
29
|
-
/// );
|
|
30
|
-
/// capture.updateConfig(updatedConfig);
|
|
31
|
-
/// ```
|
|
32
|
-
class MicAudioConfig extends AudioCaptureConfig {
|
|
33
|
-
/// Sample rate in Hz (default: 16000).
|
|
34
|
-
///
|
|
35
|
-
/// Common values: 8000, 16000, 44100, 48000.
|
|
36
|
-
/// Higher sample rates provide better quality but use more resources.
|
|
37
|
-
final int sampleRate;
|
|
38
|
-
|
|
39
|
-
/// Number of audio channels (default: 1 for mono).
|
|
40
|
-
///
|
|
41
|
-
/// - 1: Mono (single channel)
|
|
42
|
-
/// - 2: Stereo (two channels)
|
|
43
|
-
final int channels;
|
|
44
|
-
|
|
45
|
-
/// Bit depth (default: 16).
|
|
46
|
-
///
|
|
47
|
-
/// Common values: 16, 24, 32.
|
|
48
|
-
/// Higher bit depth provides better dynamic range.
|
|
49
|
-
final int bitDepth;
|
|
50
|
-
|
|
51
|
-
/// Gain boost multiplier (default: 2.5, range: 0.1 to 10.0).
|
|
52
|
-
///
|
|
53
|
-
/// Higher values increase microphone sensitivity and amplify the input signal.
|
|
54
|
-
/// Use with caution as very high values may cause distortion.
|
|
55
|
-
final double gainBoost;
|
|
56
|
-
|
|
57
|
-
/// Input volume (default: 1.0, range: 0.0 to 1.0).
|
|
58
|
-
///
|
|
59
|
-
/// Controls the input volume level:
|
|
60
|
-
/// - 0.0: Muted
|
|
61
|
-
/// - 0.5: Half volume
|
|
62
|
-
/// - 1.0: Full volume
|
|
63
|
-
final double inputVolume;
|
|
64
|
-
|
|
65
|
-
/// Creates a new [MicAudioConfig] instance.
|
|
66
|
-
///
|
|
67
|
-
/// All parameters are optional and have default values:
|
|
68
|
-
/// - [sampleRate]: 16000
|
|
69
|
-
/// - [channels]: 1
|
|
70
|
-
/// - [bitDepth]: 16
|
|
71
|
-
/// - [gainBoost]: 2.5
|
|
72
|
-
/// - [inputVolume]: 1.0
|
|
73
|
-
///
|
|
74
|
-
/// Example:
|
|
75
|
-
/// ```dart
|
|
76
|
-
/// final config = MicAudioConfig(
|
|
77
|
-
/// sampleRate: 44100,
|
|
78
|
-
/// channels: 1,
|
|
79
|
-
/// gainBoost: 2.0,
|
|
80
|
-
/// );
|
|
81
|
-
/// ```
|
|
82
|
-
MicAudioConfig({
|
|
83
|
-
this.sampleRate = 16000,
|
|
84
|
-
this.channels = 1,
|
|
85
|
-
this.bitDepth = 16,
|
|
86
|
-
this.gainBoost = 2.5,
|
|
87
|
-
this.inputVolume = 1.0,
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
/// Creates a copy of this configuration with modified values.
|
|
91
|
-
///
|
|
92
|
-
/// Only the specified parameters will be changed; others remain the same.
|
|
93
|
-
///
|
|
94
|
-
/// Example:
|
|
95
|
-
/// ```dart
|
|
96
|
-
/// final config = MicAudioConfig(
|
|
97
|
-
/// sampleRate: 16000,
|
|
98
|
-
/// gainBoost: 2.5,
|
|
99
|
-
/// );
|
|
100
|
-
///
|
|
101
|
-
/// // Increase gain boost while keeping other values
|
|
102
|
-
/// final updated = config.copyWith(gainBoost: 3.0);
|
|
103
|
-
/// // updated.sampleRate is still 16000
|
|
104
|
-
/// ```
|
|
105
|
-
MicAudioConfig copyWith({
|
|
106
|
-
int? sampleRate,
|
|
107
|
-
int? channels,
|
|
108
|
-
int? bitDepth,
|
|
109
|
-
double? gainBoost,
|
|
110
|
-
double? inputVolume,
|
|
111
|
-
}) {
|
|
112
|
-
return MicAudioConfig(
|
|
113
|
-
sampleRate: sampleRate ?? this.sampleRate,
|
|
114
|
-
channels: channels ?? this.channels,
|
|
115
|
-
bitDepth: bitDepth ?? this.bitDepth,
|
|
116
|
-
gainBoost: gainBoost ?? this.gainBoost,
|
|
117
|
-
inputVolume: inputVolume ?? this.inputVolume,
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/// Converts this configuration to a map for method channel communication.
|
|
122
|
-
///
|
|
123
|
-
/// Returns a map containing all configuration values:
|
|
124
|
-
/// - `sampleRate`: int
|
|
125
|
-
/// - `channels`: int
|
|
126
|
-
/// - `bitDepth`: int
|
|
127
|
-
/// - `gainBoost`: double
|
|
128
|
-
/// - `inputVolume`: double
|
|
129
|
-
///
|
|
130
|
-
/// Example:
|
|
131
|
-
/// ```dart
|
|
132
|
-
/// final config = MicAudioConfig(
|
|
133
|
-
/// sampleRate: 44100,
|
|
134
|
-
/// channels: 2,
|
|
135
|
-
/// );
|
|
136
|
-
/// final map = config.toMap();
|
|
137
|
-
/// // map = {'sampleRate': 44100, 'channels': 2, 'bitDepth': 16, 'gainBoost': 2.5, 'inputVolume': 1.0}
|
|
138
|
-
/// ```
|
|
139
|
-
Map<String, dynamic> toMap() {
|
|
140
|
-
return {
|
|
141
|
-
'sampleRate': sampleRate,
|
|
142
|
-
'channels': channels,
|
|
143
|
-
'bitDepth': bitDepth,
|
|
144
|
-
'gainBoost': gainBoost,
|
|
145
|
-
'inputVolume': inputVolume,
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
@override
|
|
150
|
-
String toString() {
|
|
151
|
-
return 'MicConfig(sampleRate: $sampleRate, channels: $channels, bitDepth: $bitDepth, gainBoost: $gainBoost, inputVolume: $inputVolume)';
|
|
152
|
-
}
|
|
153
|
-
}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import 'package:desktop_audio_capture/audio_capture.dart';
|
|
2
|
-
|
|
3
|
-
/// Configuration class for system audio capture.
|
|
4
|
-
///
|
|
5
|
-
/// This class allows you to configure audio capture parameters for system audio
|
|
6
|
-
/// (audio output from the device), such as sample rate and number of channels.
|
|
7
|
-
///
|
|
8
|
-
/// Example:
|
|
9
|
-
/// ```dart
|
|
10
|
-
/// // Create with default values
|
|
11
|
-
/// final config = SystemAudioConfig();
|
|
12
|
-
///
|
|
13
|
-
/// // Create with custom values
|
|
14
|
-
/// final customConfig = SystemAudioConfig(
|
|
15
|
-
/// sampleRate: 44100,
|
|
16
|
-
/// channels: 2,
|
|
17
|
-
/// );
|
|
18
|
-
///
|
|
19
|
-
/// // Use with capture
|
|
20
|
-
/// final capture = SystemAudioCapture(config: customConfig);
|
|
21
|
-
///
|
|
22
|
-
/// // Update configuration
|
|
23
|
-
/// final updatedConfig = customConfig.copyWith(
|
|
24
|
-
/// sampleRate: 48000,
|
|
25
|
-
/// );
|
|
26
|
-
/// capture.updateConfig(updatedConfig);
|
|
27
|
-
/// ```
|
|
28
|
-
class SystemAudioConfig extends AudioCaptureConfig {
|
|
29
|
-
/// Sample rate in Hz (default: 16000).
|
|
30
|
-
///
|
|
31
|
-
/// Common values: 8000, 16000, 44100, 48000.
|
|
32
|
-
/// Higher sample rates provide better quality but use more resources.
|
|
33
|
-
final int sampleRate;
|
|
34
|
-
|
|
35
|
-
/// Number of audio channels (default: 1 for mono).
|
|
36
|
-
///
|
|
37
|
-
/// - 1: Mono (single channel)
|
|
38
|
-
/// - 2: Stereo (two channels)
|
|
39
|
-
final int channels;
|
|
40
|
-
|
|
41
|
-
/// Creates a new [SystemAudioConfig] instance.
|
|
42
|
-
///
|
|
43
|
-
/// All parameters are optional and have default values:
|
|
44
|
-
/// - [sampleRate]: 16000
|
|
45
|
-
/// - [channels]: 1
|
|
46
|
-
///
|
|
47
|
-
/// Example:
|
|
48
|
-
/// ```dart
|
|
49
|
-
/// final config = SystemAudioConfig(
|
|
50
|
-
/// sampleRate: 44100,
|
|
51
|
-
/// channels: 2,
|
|
52
|
-
/// );
|
|
53
|
-
/// ```
|
|
54
|
-
SystemAudioConfig({
|
|
55
|
-
this.sampleRate = 16000,
|
|
56
|
-
this.channels = 1,
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
/// Creates a copy of this configuration with modified values.
|
|
60
|
-
///
|
|
61
|
-
/// Only the specified parameters will be changed; others remain the same.
|
|
62
|
-
///
|
|
63
|
-
/// Example:
|
|
64
|
-
/// ```dart
|
|
65
|
-
/// final config = SystemAudioConfig(
|
|
66
|
-
/// sampleRate: 16000,
|
|
67
|
-
/// channels: 1,
|
|
68
|
-
/// );
|
|
69
|
-
///
|
|
70
|
-
/// // Change to stereo while keeping sample rate
|
|
71
|
-
/// final updated = config.copyWith(channels: 2);
|
|
72
|
-
/// // updated.sampleRate is still 16000
|
|
73
|
-
/// ```
|
|
74
|
-
SystemAudioConfig copyWith({
|
|
75
|
-
int? sampleRate,
|
|
76
|
-
int? channels,
|
|
77
|
-
}) {
|
|
78
|
-
return SystemAudioConfig(
|
|
79
|
-
sampleRate: sampleRate ?? this.sampleRate,
|
|
80
|
-
channels: channels ?? this.channels,
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/// Converts this configuration to a map for method channel communication.
|
|
85
|
-
///
|
|
86
|
-
/// Returns a map containing all configuration values:
|
|
87
|
-
/// - `sampleRate`: int
|
|
88
|
-
/// - `channels`: int
|
|
89
|
-
///
|
|
90
|
-
/// Example:
|
|
91
|
-
/// ```dart
|
|
92
|
-
/// final config = SystemAudioConfig(
|
|
93
|
-
/// sampleRate: 44100,
|
|
94
|
-
/// channels: 2,
|
|
95
|
-
/// );
|
|
96
|
-
/// final map = config.toMap();
|
|
97
|
-
/// // map = {'sampleRate': 44100, 'channels': 2}
|
|
98
|
-
/// ```
|
|
99
|
-
Map<String, dynamic> toMap() {
|
|
100
|
-
return {
|
|
101
|
-
'sampleRate': sampleRate,
|
|
102
|
-
'channels': channels,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
@override
|
|
107
|
-
String toString() {
|
|
108
|
-
return 'SystemAudioConfig(sampleRate: $sampleRate, channels: $channels)';
|
|
109
|
-
}
|
|
110
|
-
}
|