Commit c9bcf73
authored
feat(core, native, security): introduce security suite and major core enhancements and bug fixes (#104)
This major update introduces a comprehensive security suite for audio content protection and identification, alongside significant core engine enhancements and improved NativeAOT compatibility.
### Security Suite
- Content Encryption: Implements seekable AES-256-CTR stream encryption within a new secure audio container format (`.sfa`), supporting embedded digital signatures.
- Digital Signatures: Adds ECDSA-P384 signing and verification for files and streams. Project files (`.sfproj`) and secure audio containers can now be signed to ensure integrity and authenticity.
- Audio Watermarking:
- Robust (Ownership): Embeds inaudible data using Direct-Sequence Spread Spectrum (DSSS) that can survive common attacks like re-encoding or volume changes. Includes a `WatermarkTuner` to find optimal settings.
- Fragile (Integrity): Embeds a fragile watermark using block-chained LSB hashing to detect tampering.
- Acoustic Fingerprinting: Implements audio identification by generating robust fingerprints from spectral peaks. Includes an `IFingerprintStore` interface for database integration.
### Core Enhancements
- Time-Stretching: The WSOLA time-stretcher is now fully configurable with quality presets (Fast, Balanced, HighQuality, Audiophile), allowing a trade-off between performance and audio fidelity.
- NativeAOT Compatibility: Introduces a `TypeRegistry` and a source-generated `SoundFlowJsonContext` to ensure custom modifiers and other types are not trimmed by the AOT compiler.
- Codec & API Improvements:
- The native FFmpeg wrapper now uses a FIFO buffer for more robust encoding and links against the LAME library for high-quality MP3 output.
- The `Recorder` API now uses the `Result` pattern for better error handling and integrates directly with digital signing.
- The logging system now uses a `LogEntry` struct for improved performance and structured data.
### Build, Samples & Docs
- Build: Adds static linking of the LAME MP3 encoder library to the FFmpeg codec. CI runners have been updated.
- Samples: Adds six new high-quality sample projects demonstrating all new security features. The `SimplePlayer` sample has been completely refactored for clarity.
- Documentation: Adds `CITATION.cff` for academic use, `SOUNDFLOW-THIRD-PARTY-NOTICES.txt` for license compliance, and significantly updates the main README.
BREAKING CHANGE:
- The `Log.OnLog` event signature has changed from `Action<LogLevel, string>` to `Action<LogEntry>`. Subscribers must be updated to handle the new `LogEntry` struct.
- The `Filter.FilterType` enum has been moved to a global `SoundFlow.Enums.FilterType`. Code using the old nested enum must be updated.
- Methods on the `Recorder` component, such as `StartRecording` and `StopRecordingAsync`, now return `Result` or `Task<Result>` instead of `void` or `Task`. Callers must now handle the returned result object.1 parent 897b211 commit c9bcf73
177 files changed
Lines changed: 7692 additions & 1324 deletions
File tree
- .github
- ISSUE_TEMPLATE
- workflows
- Codecs/SoundFlow.Codecs.FFMpeg
- runtimes
- android-arm64/native
- android-arm/native
- android-x64/native
- freebsd-arm64/native
- freebsd-x64/native
- ios-arm64/native/soundflow-ffmpeg.framework
- linux-arm64/native
- linux-arm/native
- linux-x64/native
- osx-arm64/native
- osx-x64/native
- win-arm64/native
- win-x64/native
- win-x86/native
- Extensions/SoundFlow.Extensions.WebRtc.Apm
- Components
- Modifiers
- runtimes
- android-arm64/native
- android-x64/native
- ios-arm64/native
- win-x64/native
- win-x86/native
- Midi/SoundFlow.Midi.PortMidi
- Devices
- runtimes
- freebsd-arm64/native
- freebsd-x64/native
- linux-arm64/native
- linux-arm/native
- linux-x64/native
- win-arm64/native
- win-x64/native
- win-x86/native
- Native/ffmpeg-codec
- Samples
- SoundFlow.Samples.EditingMixer
- SoundFlow.Samples.Recording
- SoundFlow.Samples.Security.Authentication
- SoundFlow.Samples.Security.Encryption
- SoundFlow.Samples.Security.Fingerprinting
- SoundFlow.Samples.Security.IntegrityWatermarking
- SoundFlow.Samples.Security.OwnershipWatermarking
- SoundFlow.Samples.SimplePlayer
- SoundFlow.Samples.SwitchDevices
- Src
- Abstracts
- Backends/MiniAudio
- runtimes
- android-arm64/native
- android-arm/native
- android-x64/native
- iOS-arm64/native/miniaudio.framework
- win-arm64/native
- win-x64/native
- win-x86/native
- Components
- Editing
- Mapping
- Persistence
- Enums
- Interfaces
- Metadata
- Midi
- Models
- Readers
- Format
- Tags
- Midi
- Abstracts
- Routing
- Modifiers
- Providers
- Security
- Analyzers
- Configuration
- Containers
- Models
- Modifiers
- Payloads
- Stores
- Utils
- Structs
- Synthesis/Voices
- Utils
- Visualization
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
171 | 170 | | |
172 | 171 | | |
173 | 172 | | |
| |||
199 | 198 | | |
200 | 199 | | |
201 | 200 | | |
202 | | - | |
| 201 | + | |
203 | 202 | | |
204 | 203 | | |
205 | 204 | | |
| |||
0 commit comments