Skip to content

Commit 16aa778

Browse files
committed
refactor: bump version to 1.4.1 and update audio component API
Bumped the project version in `SoundFlow.csproj` to 1.4.1 and removed the unneeded `STATEMENT.md` from the package. Added comprehensive XML documentation to `SoundComponent.Process`, exposed the method as public, and clarified its purpose and usage. Updated the event raisers in `AudioEngine` to public for better external accessibility and Made `CachedRenderEventArgs` protected so subclasses can reuse it.
1 parent c9bcf73 commit 16aa778

4 files changed

Lines changed: 22 additions & 13 deletions

File tree

Src/Abstracts/AudioEngine.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,20 @@ protected AudioEngine()
100100
/// For internal use by audio device implementations. Raises the <see cref="DeviceStarted"/> event.
101101
/// </summary>
102102
/// <param name="device">The device that has started.</param>
103-
internal void RaiseDeviceStarted(AudioDevice device) => DeviceStarted?.Invoke(this, new DeviceEventArgs(device));
103+
public void RaiseDeviceStarted(AudioDevice device) => DeviceStarted?.Invoke(this, new DeviceEventArgs(device));
104104

105105
/// <summary>
106106
/// For internal use by audio device implementations. Raises the <see cref="DeviceStopped"/> event.
107107
/// </summary>
108108
/// <param name="device">The device that has stopped.</param>
109-
internal void RaiseDeviceStopped(AudioDevice device) => DeviceStopped?.Invoke(this, new DeviceEventArgs(device));
109+
public void RaiseDeviceStopped(AudioDevice device) => DeviceStopped?.Invoke(this, new DeviceEventArgs(device));
110110

111111
/// <summary>
112112
/// For internal use by audio device implementations. Raises the <see cref="AudioFramesRendered"/> event
113113
/// using a reusable EventArgs object to avoid allocation overhead in the hot path.
114114
/// </summary>
115115
/// <param name="args">The cached event arguments object.</param>
116-
internal void RaiseAudioFramesRendered(AudioFramesRenderedEventArgs args) =>
116+
public void RaiseAudioFramesRendered(AudioFramesRenderedEventArgs args) =>
117117
AudioFramesRendered?.Invoke(this, args);
118118

119119
#endregion

Src/Abstracts/Devices/AudioPlaybackDevice.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public abstract class AudioPlaybackDevice : AudioDevice
1818
/// <summary>
1919
/// Cached event args object to prevent GC allocations every frame.
2020
/// </summary>
21-
internal readonly AudioFramesRenderedEventArgs CachedRenderEventArgs;
21+
protected readonly AudioFramesRenderedEventArgs CachedRenderEventArgs;
2222

2323
/// <summary>
2424
/// Initializes a new instance of the <see cref="AudioPlaybackDevice"/> class.

Src/Abstracts/SoundComponent.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,22 @@ public void RemoveAnalyzer(AudioAnalyzer analyzer)
378378
}
379379
}
380380

381-
internal void Process(Span<float> outputBuffer, int channels)
381+
/// <summary>
382+
/// Processes the audio data through the component.
383+
/// This method is called by the audio engine for each buffer of audio data.
384+
/// The component processes the audio data by reading the audio data from the component's inputs,
385+
/// generating new audio data, and applying any enabled modifiers and analyzers.
386+
/// The processed audio data is then mixed into the <paramref name="outputBuffer"/>.
387+
/// </summary>
388+
/// <param name="outputBuffer">The buffer to mix the processed audio data into.</param>
389+
/// <param name="channels">The number of channels in the <paramref name="outputBuffer"/>.</param>
390+
/// <remarks>
391+
/// The <paramref name="outputBuffer"/> is cleared before the audio data is processed but not after.
392+
/// This method is for internal use only to allow custom audio engine implementations
393+
/// to manually drive component processing. Do not call from application code; use
394+
/// component connection graphs instead.
395+
/// </remarks>
396+
public void Process(Span<float> outputBuffer, int channels)
382397
{
383398
if (!Enabled || Mute || IsDisposed) return;
384399

@@ -570,7 +585,7 @@ public virtual void Dispose()
570585
}
571586

572587
/// <summary>
573-
/// Releases unmanaged and - optionally - managed resources.
588+
/// Releases unmanaged and managed resources.
574589
/// </summary>
575590
/// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
576591
protected virtual void Dispose(bool disposing)

Src/SoundFlow.csproj

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<PackageIcon>logo.png</PackageIcon>
1818
<PackageReadmeFile>README.md</PackageReadmeFile>
1919
<PackageTags>audio, sound, mp3, wav, playback, record, voice, volume, fft, simd, crossplatform, miniaudio, c#, .net, echo, noise</PackageTags>
20-
<Version>1.4.0</Version>
20+
<Version>1.4.1</Version>
2121
<PackageReleaseNotes>https://github.com/LSXPrime/SoundFlow/releases</PackageReleaseNotes>
2222
<GenerateDocumentationFile>true</GenerateDocumentationFile>
2323
<Company>LSXPrime</Company>
@@ -43,10 +43,4 @@
4343
<None Include="..\logo.png" Pack="true" PackagePath="" />
4444
<None Include="SoundFlow.targets" Pack="true" PackagePath="" />
4545
</ItemGroup>
46-
47-
<ItemGroup>
48-
<Content Include="..\STATEMENT.md">
49-
<Link>STATEMENT.md</Link>
50-
</Content>
51-
</ItemGroup>
5246
</Project>

0 commit comments

Comments
 (0)