![]() |
Ryle Radio 1.0.0
An open-source "radio" system for Unity, allowing tracks, tuning, broadcasters, and more!
|
A eventType of RadioTrack that plays from a chosen AudioClip object. More...
Public Member Functions | |
| override void | Init () |
| Initializes this track. This needs to be called every time the clip is changed. | |
| void | ReadClipAndForceToMono () |
| Reads the clip into the Samples array, and combines its channels into one. | |
| override float | GetSample (int _sampleIndex) |
| Gets a sample from the clip. | |
| Public Member Functions inherited from RyleRadio.Tracks.RadioTrack | |
| void | Init () |
| Initializes this track. | |
| float | GetSample (int _sampleIndex) |
| Gets a sample from the track. | |
| virtual void | AddToPlayerEndCallback (ref Action< RadioTrackPlayer > _callback) |
| Activates an event to run whenever this track ends. This is mainly used for stations to switch track when the previous one ends. | |
Public Attributes | |
| AudioClip | clip |
| The clip that this track plays. | |
Static Public Attributes | |
| const string | DISPLAY_NAME = "Audio Clip" |
| The display name of this track in the editor. Required in RadioTrack. | |
Properties | |
| float[] | Samples [get, set] |
| The individual samples of this clip, as it needs to be played sample-by-sample (a limitation of Unity's AudioClip) | |
| bool | IsInStation [get, set] |
| Whether or not this is in a StationRadioTrack Required by IStationTrack. | |
| Properties inherited from RyleRadio.Tracks.RadioTrack | |
| float | SampleRate [get, set] |
| The sample rate of this track. | |
| virtual int | SampleCount [get, set] |
| The number of samples in this track. | |
A eventType of RadioTrack that plays from a chosen AudioClip object.
Definition at line 10 of file ClipRadioTrack.cs.
| override float RyleRadio.Tracks.ClipRadioTrack.GetSample | ( | int | _sampleIndex | ) |
Gets a sample from the clip.
| _sampleIndex | The index of the sample |
Implements RyleRadio.Tracks.IRadioTrack.
Definition at line 82 of file ClipRadioTrack.cs.
| override void RyleRadio.Tracks.ClipRadioTrack.Init | ( | ) |
Initializes this track. This needs to be called every time the clip is changed.
Implements RyleRadio.Tracks.IRadioTrack.
Definition at line 37 of file ClipRadioTrack.cs.
| void RyleRadio.Tracks.ClipRadioTrack.ReadClipAndForceToMono | ( | ) |
Reads the clip into the Samples array, and combines its channels into one.
We need to flatten the clip into one channel to play it from a RadioOutput as the Output is only using one channel. Theoretically, we could expand the Output to use multiple channels, but given this would be the only track eventType to do this it's probably not worth the significant effort.
For the moment, we'll treat Outputs as AM radios (which are mono in real life)
Definition at line 51 of file ClipRadioTrack.cs.
Referenced by Init().
| AudioClip RyleRadio.Tracks.ClipRadioTrack.clip |
The clip that this track plays.
Definition at line 20 of file ClipRadioTrack.cs.
Referenced by Init(), and ReadClipAndForceToMono().
|
static |
The display name of this track in the editor. Required in RadioTrack.
Definition at line 15 of file ClipRadioTrack.cs.
|
getset |
Whether or not this is in a StationRadioTrack Required by IStationTrack.
Implements RyleRadio.Tracks.IStationTrack.
Definition at line 31 of file ClipRadioTrack.cs.
|
getsetprotected |
The individual samples of this clip, as it needs to be played sample-by-sample (a limitation of Unity's AudioClip)
Definition at line 25 of file ClipRadioTrack.cs.
Referenced by GetSample(), Init(), and ReadClipAndForceToMono().