mirror of
https://github.com/unclshura/ABStemPlayer.git
synced 2026-08-07 00:43:38 +00:00
26 lines
679 B
C#
26 lines
679 B
C#
using AudioCore.Impl;
|
|
|
|
namespace AudioCore.Models;
|
|
|
|
public readonly struct AudioBlock : IDisposable
|
|
{
|
|
public AudioBuffer<float> Buffer { get; }
|
|
public int SampleRate { get; }
|
|
public int Channels { get; }
|
|
public long Position { get; }
|
|
public int Frames => Buffer.Length / Channels;
|
|
|
|
public AudioBlock(AudioBuffer<float> buffer, int sampleRate, int channels, long samplePosition)
|
|
{
|
|
Buffer = buffer;
|
|
SampleRate = sampleRate;
|
|
Channels = channels;
|
|
Position = samplePosition;
|
|
}
|
|
|
|
public Span<float> Span => Buffer.Span;
|
|
public int Length => Buffer.Length;
|
|
|
|
public void Dispose() => Buffer.Dispose();
|
|
}
|