Skip to content

Commit c9bcf73

Browse files
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

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ body:
8080
```csharp
8181
// Your MRE code here
8282
```
83-
render: shell
83+
render: csharp
8484
validations:
8585
required: false
8686

@@ -93,7 +93,7 @@ body:
9393
```
9494
(Paste full error message and stack trace here)
9595
```
96-
render: shell
96+
render: csharp
9797
validations:
9898
required: false
9999

.github/ISSUE_TEMPLATE/documentation_issue.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ body:
8787
```csharp
8888
// Improved code example
8989
```
90-
render: shell
90+
render: markdown
9191
validations:
9292
required: false
9393

.github/ISSUE_TEMPLATE/feature_request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ body:
6565
// public class NewComponent : SoundComponent { ... }
6666
// public void ExistingComponent.NewMethod(ParameterType param) { ... }
6767
```
68-
render: shell
68+
render: csharp
6969
validations:
7070
required: false
7171

.github/ISSUE_TEMPLATE/performance_issue.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ body:
7777
```csharp
7878
// Your MRE code here
7979
```
80-
render: shell
80+
render: csharp
8181
validations:
8282
required: false
8383

@@ -91,7 +91,7 @@ body:
9191
* Exported profiling sessions (if shareable).
9292
* Key findings from the profiler.
9393
placeholder: Paste profiling data, links, or key findings here.
94-
render: shell
94+
render: markdown
9595
validations:
9696
required: false
9797

.github/ISSUE_TEMPLATE/platform_specific_issue.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ body:
125125
```csharp
126126
// Your MRE code here
127127
```
128-
render: shell
128+
render: csharp
129129
validations:
130130
required: false
131131

@@ -137,7 +137,7 @@ body:
137137
```
138138
(Paste full error message and stack trace here)
139139
```
140-
render: shell
140+
render: csharp
141141
validations:
142142
required: false
143143

.github/ISSUE_TEMPLATE/question.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ body:
5858
```csharp
5959
// Your code here
6060
```
61-
render: shell
61+
render: csharp
6262
validations:
6363
required: false
6464

.github/ISSUE_TEMPLATE/security_vulnerability_report.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ body:
7171
```csharp
7272
// PoC code (if safe to share publicly)
7373
```
74-
render: shell
74+
render: markdown
7575
validations:
7676
required: false
7777

.github/workflows/build-extensions-apm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
cross_file: "linux-arm64.crossfile"
4949

5050
# macOS builds
51-
- os: macos-latest
51+
- os: macos-15-intel
5252
rid: osx-x64
5353
platform: macOS
5454
arch: x86_64

.github/workflows/build-ffmpeg.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ jobs:
162162
matrix:
163163
include:
164164
- arch: x64
165-
os: macos-13
165+
os: macos-15-intel
166166
cmake_arch: x86_64
167167
- arch: arm64
168168
os: macos-14

.github/workflows/build-miniaudio.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,13 @@ jobs:
160160
lib_extension: ".dll"
161161
toolchain: "Visual Studio 17 2022"
162162

163-
# Disabled due to https://github.com/mackron/miniaudio/issues/1045
164-
#- os: windows-latest
165-
# rid: win-arm64
166-
# platform: Windows
167-
# arch: ARM64
168-
# cmake_target_arch: ARM64
169-
# lib_extension: ".dll"
170-
# toolchain: "Visual Studio 17 2022"
163+
- os: windows-latest
164+
rid: win-arm64
165+
platform: Windows
166+
arch: ARM64
167+
cmake_target_arch: ARM64
168+
lib_extension: ".dll"
169+
toolchain: "Visual Studio 17 2022"
171170

172171
# Linux builds
173172
- os: ubuntu-22.04
@@ -199,7 +198,7 @@ jobs:
199198
cmake_target_arch: arm64
200199
lib_extension: ".dylib"
201200

202-
- os: macos-latest
201+
- os: macos-15-intel
203202
rid: osx-x64
204203
platform: macOS
205204
arch: x86_64

0 commit comments

Comments
 (0)