mirror of
https://github.com/unclshura/ABStemPlayer.git
synced 2026-09-21 11:13:38 +00:00
Common interface for audio blocks
This commit is contained in:
parent
d8e1317a74
commit
4c8d4d2ed9
@ -33,6 +33,8 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<Version>1.0.0</Version>
|
||||
<BuildNumber>0</BuildNumber>
|
||||
<SourceRevisionId>0000</SourceRevisionId>
|
||||
<InformationalVersion>$(Version).$(BuildNumber)+$(SourceRevisionId)</InformationalVersion>
|
||||
<AssemblyVersion>$(Version)</AssemblyVersion>
|
||||
<FileVersion>$(Version).$(BuildNumber)</FileVersion>
|
||||
|
||||
@ -115,7 +115,7 @@ public sealed class RubberBandTimeStretchEngine : ITimeStretchEngine, IAsyncDisp
|
||||
return Task.CompletedTask;
|
||||
try
|
||||
{
|
||||
proc.Stdin.Flush();
|
||||
proc.Stdin?.Flush();
|
||||
}
|
||||
catch (System.ObjectDisposedException)
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@ using AudioCore.Impl;
|
||||
|
||||
namespace AudioCore.Models;
|
||||
|
||||
public readonly struct AudioBlock : IDisposable
|
||||
public readonly struct AudioBlock : IAudioBlock, IDisposable
|
||||
{
|
||||
public AudioBuffer<float> Buffer { get; }
|
||||
public int SampleRate { get; }
|
||||
|
||||
14
AudioCore/Models/IAudioBlock.cs
Normal file
14
AudioCore/Models/IAudioBlock.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using AudioCore.Impl;
|
||||
|
||||
namespace AudioCore.Models;
|
||||
|
||||
public interface IAudioBlock : IDisposable
|
||||
{
|
||||
AudioBuffer<float> Buffer { get; }
|
||||
int SampleRate { get; }
|
||||
int Channels { get; }
|
||||
long Position { get; }
|
||||
int Frames { get; }
|
||||
int Length { get; }
|
||||
Span<float> Span { get; }
|
||||
}
|
||||
@ -2,7 +2,7 @@ using AudioCore.Impl;
|
||||
|
||||
namespace AudioCore.Models;
|
||||
|
||||
public readonly struct MixedAudioBlock : IDisposable
|
||||
public readonly struct MixedAudioBlock : IAudioBlock, IDisposable
|
||||
{
|
||||
public AudioBuffer<float> Buffer { get; }
|
||||
public int Frames { get; }
|
||||
@ -10,6 +10,8 @@ public readonly struct MixedAudioBlock : IDisposable
|
||||
public int SampleRate { get; }
|
||||
public long Position { get; }
|
||||
|
||||
public Span<float> Span => Buffer.Span;
|
||||
public int Length => Buffer.Length;
|
||||
public MixedAudioBlock(AudioBuffer<float> buffer, int frames, int channels, int sampleRate, long samplePosition)
|
||||
{
|
||||
Buffer = buffer;
|
||||
|
||||
@ -2,7 +2,7 @@ using AudioCore.Impl;
|
||||
|
||||
namespace AudioCore.Models;
|
||||
|
||||
public readonly struct TimeStretchedAudioBlock : IDisposable
|
||||
public readonly struct TimeStretchedAudioBlock : IAudioBlock, IDisposable
|
||||
{
|
||||
public AudioBuffer<float> Buffer { get; }
|
||||
public int Frames { get; }
|
||||
@ -10,6 +10,8 @@ public readonly struct TimeStretchedAudioBlock : IDisposable
|
||||
public int SampleRate { get; }
|
||||
public long Position { get; }
|
||||
|
||||
public Span<float> Span => Buffer.Span;
|
||||
public int Length => Buffer.Length;
|
||||
public TimeStretchedAudioBlock(AudioBuffer<float> buffer, int frames, int channels, int sampleRate, long position)
|
||||
{
|
||||
Buffer = buffer;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user