|
BGC Tools
|
Simplest implementation of a samplebuffer-based stream. More...


Public Member Functions | |
| SimpleAudioClip (float[] samples, int channels) | |
| override int | Read (float[] data, int offset, int count) |
| Copy count samples into the Data buffer, starting at offset. More... | |
| override void | Seek (int position) |
| Seek to the indicated position in the stream More... | |
| override void | Reset () |
| Sets this internal state of this stream to the initial state More... | |
| override IEnumerable< double > | GetChannelRMS () |
| The RMS amplitude of each channel More... | |
Public Member Functions inherited from BGC.Audio.BGCStream | |
| void | Initialize () |
| Perform any calculations necessary to prepare the Stream More... | |
Data Fields | |
| override int | TotalSamples => Samples.Length |
| override int | ChannelSamples => Samples.Length / Channels |
| override int | Channels => _channels |
Data Fields inherited from BGC.Audio.BGCAudioClip | |
| float | Duration => ChannelSamples / SamplingRate |
| override float | SamplingRate => 44100f |
Properties | |
| int | Position [get, set] |
| int | RawPosition [get, private set] |
| float [] | Samples [get] |
Properties inherited from BGC.Audio.BGCStream | |
| abstract int | Channels [get] |
| abstract int | TotalSamples [get] |
| abstract int | ChannelSamples [get] |
| abstract float | SamplingRate [get] |
Properties inherited from BGC.Audio.IBGCStream | |
| int | Channels [get] |
| The number of underlying Channels of this BGCStream More... | |
| int | TotalSamples [get] |
| The total number of Samples of this BGCStream More... | |
| int | ChannelSamples [get] |
| The number of Samples of each channel for this BGCStream More... | |
| float | SamplingRate [get] |
| The sampling rate of the Stream More... | |
Private Attributes | |
| readonly int | _channels |
| int | RemainingChannelSamples => RemainingTotalSamples / Channels |
| int | RemainingTotalSamples => GeneralMath.Clamp(Samples.Length - RawPosition, 0, Samples.Length) |
| IEnumerable< double > | _channelRMS = null |
Additional Inherited Members | |
Protected Member Functions inherited from BGC.Audio.BGCStream | |
| virtual void | _Initialize () |
Protected Attributes inherited from BGC.Audio.BGCStream | |
| bool | initialized = false |
Simplest implementation of a samplebuffer-based stream.
Definition at line 10 of file SimpleAudioClip.cs.
|
inline |
Definition at line 31 of file SimpleAudioClip.cs.
|
inlinevirtual |
The RMS amplitude of each channel
Implements BGC.Audio.BGCStream.
Definition at line 60 of file SimpleAudioClip.cs.
|
inlinevirtual |
Copy count samples into the Data buffer, starting at offset.
Implements BGC.Audio.BGCStream.
Definition at line 37 of file SimpleAudioClip.cs.
References BGC.Mathematics.GeneralMath.Clamp().

|
virtual |
Sets this internal state of this stream to the initial state
Implements BGC.Audio.BGCStream.
|
virtual |
Seek to the indicated position in the stream
Implements BGC.Audio.BGCStream.
|
private |
Definition at line 59 of file SimpleAudioClip.cs.
|
private |
Definition at line 25 of file SimpleAudioClip.cs.
| override int BGC.Audio.SimpleAudioClip.Channels => _channels |
Definition at line 26 of file SimpleAudioClip.cs.
Referenced by BGC.Tests.TestOverlapAdd.TestPhaseVocoding().
| override int BGC.Audio.SimpleAudioClip.ChannelSamples => Samples.Length / Channels |
Definition at line 21 of file SimpleAudioClip.cs.
|
private |
Definition at line 28 of file SimpleAudioClip.cs.
|
private |
Definition at line 29 of file SimpleAudioClip.cs.
| override int BGC.Audio.SimpleAudioClip.TotalSamples => Samples.Length |
Definition at line 20 of file SimpleAudioClip.cs.
|
getset |
Definition at line 13 of file SimpleAudioClip.cs.
|
getprivate set |
Definition at line 18 of file SimpleAudioClip.cs.
|
get |
Definition at line 23 of file SimpleAudioClip.cs.
Referenced by BGC.Tests.TestOverlapAdd.TestPhaseVocoding().
1.8.13