reckfellENGINE

AudioStreamOggVorbis

A class representing an Ogg Vorbis audio stream.

On this page
class AudioStreamOggVorbisReckfellSharpInherits AudioStream

A class representing an Ogg Vorbis audio stream.

The AudioStreamOggVorbis class is a specialized AudioStream for handling Ogg Vorbis file formats. It offers functionality for loading and playing back Ogg Vorbis files, as well as managing looping and other playback properties. More info can be found in ResourceImporterOggVorbis. This class is part of the audio stream system, which also supports WAV files through the AudioStreamWav class, and MP3 files through the AudioStreamMP3 class.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

AudioStreamOggVorbisConstructor
# AudioStreamOggVorbis
C#
public AudioStreamOggVorbis();

Properties7

BarBeatsProperty
# BarBeats
C#
public int BarBeats { get; set; }

Number of musical beats per bar, for example 4 for a four-beat bar. This is composition metadata, not bars within one beat or an automatically analyzed audio value.

BeatCountProperty
# BeatCount
C#
public int BeatCount { get; set; }

The length of the audio track, in beats. The actual duration of the audio file might be longer than what is indicated by this property. It defines the end of the audio for looping, AudioStreamPlaylist, and AudioStreamInteractive.

BpmProperty
# Bpm
C#
public double Bpm { get; set; }

The tempo of the audio track, measured in beats per minute.

LoopProperty
# Loop
C#
public bool Loop { get; set; }

If true, the stream will play again from the specified AudioStreamOggVorbis.LoopOffset once it reaches the end of the audio track, or once it reaches the end of the last beat according to the amount specified in AudioStreamOggVorbis.BeatCount. Useful for ambient sounds and background music.

LoopOffsetProperty
# LoopOffset
C#
public double LoopOffset { get; set; }

Loop restart position in seconds when Loop is enabled. It is not a WAV frame index and does not specify an independent loop end. Check it against the actual recording.

PacketSequenceProperty
# PacketSequence
C#
public OggPacketSequence PacketSequence { get; set; }

Contains the raw Ogg data for this stream.

TagsProperty
# Tags
C#
public Reckfell.Collections.Dictionary Tags { get; set; }

Contains user-defined tags if found in the Ogg Vorbis data. Commonly used tags include title, artist, album, tracknumber, and date (date does not have a standard date format). Note: No tag is guaranteed to be present in every file, so make sure to account for the keys not always existing.

Methods17

GetBarBeatsint
# GetBarBeats
C#
public int GetBarBeats();
Returns int
GetBeatCountint
# GetBeatCount
C#
public int GetBeatCount();
Returns int
GetBpmdouble
# GetBpm
C#
public double GetBpm();
Returns double
GetLoopOffsetdouble
# GetLoopOffset
C#
public double GetLoopOffset();
Returns double
GetPacketSequenceOggPacketSequence
# GetPacketSequence
C#
public OggPacketSequence GetPacketSequence();
Returns OggPacketSequence
GetTagsReckfell.Collections.Dictionary
# GetTags
C#
public Reckfell.Collections.Dictionary GetTags();
Returns Reckfell.Collections.Dictionary
HasLoopbool
# HasLoop
C#
public bool HasLoop();
Returns bool
LoadFromBuffer2 overloads
# LoadFromBuffer · 1/2
C#
public static AudioStreamOggVorbis LoadFromBuffer(byte[] streamData);

Creates a new AudioStreamOggVorbis instance from the given buffer. The buffer must contain Ogg Vorbis data.

Parameters
NameTypeDefault
streamDatabyte[]—
Returns AudioStreamOggVorbis
# LoadFromBuffer · 2/2
C#
public static AudioStreamOggVorbis LoadFromBuffer(ReadOnlySpan<byte> streamData);

Creates a new AudioStreamOggVorbis instance from the given buffer. The buffer must contain Ogg Vorbis data.

Parameters
NameTypeDefault
streamDataReadOnlySpan<byte>—
Returns AudioStreamOggVorbis
LoadFromFileAudioStreamOggVorbis
# LoadFromFile
C#
public static AudioStreamOggVorbis LoadFromFile(string path);

Reads a raw audio file directly without applying editor .import settings. Use ResourceLoader.Load for a project asset with its imported settings. Set loop and music metadata on the result explicitly.

Parameters
NameTypeDefault
pathstring—
path

Path to the actual source file. Ensure it is available in the chosen build; an imported resource path does not guarantee the original bytes are shipped.

Returns AudioStreamOggVorbis

Loaded audio resource, or null on a reading/format error. Check the result before playback.

SetBarBeatsvoid
# SetBarBeats
C#
public void SetBarBeats(int count);
Parameters
NameTypeDefault
countint—
SetBeatCountvoid
# SetBeatCount
C#
public void SetBeatCount(int count);
Parameters
NameTypeDefault
countint—
SetBpmvoid
# SetBpm
C#
public void SetBpm(double bpm);
Parameters
NameTypeDefault
bpmdouble—
SetLoopvoid
# SetLoop
C#
public void SetLoop(bool enable);
Parameters
NameTypeDefault
enablebool—
SetLoopOffsetvoid
# SetLoopOffset
C#
public void SetLoopOffset(double seconds);
Parameters
NameTypeDefault
secondsdouble—
SetPacketSequencevoid
# SetPacketSequence
C#
public void SetPacketSequence(OggPacketSequence packetSequence);
Parameters
NameTypeDefault
packetSequenceOggPacketSequence—
SetTagsvoid
# SetTags
C#
public void SetTags(Reckfell.Collections.Dictionary tags);
Parameters
NameTypeDefault
tagsReckfell.Collections.Dictionary—
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.