Skip to content

AudioSource Extension

Jonathan Hale edited this page Aug 28, 2016 · 1 revision

Audio source properties are exported to something like this in ogex:

Node $node1
{
	Name {string {"Speaker"}}

	Transform
	{
		float[16]
		{
			{1.0, 0.0, 0.0, 0.0,
			 0.0, 1.0, 0.0, 0.0,
			 0.0, 0.0, 1.0, 0.0,
			 0.0, 0.0, 5.0, 1.0}
		}
	}

	Extension (applic = "Blender", type = "AudioSource")
	{
		string {"audio/Test.ogg"}

		Extension (applic = "Blender", type = "AS/gain")
		{
			float {0.5}
		}

		Extension (applic = "Blender", type = "AS/gain_min")
		{
			float {0.1}
		}

		Extension (applic = "Blender", type = "AS/gain_max")
		{
			float {0.9}
		}

		Extension (applic = "Blender", type = "AS/rolloff")
		{
			float {0.5}
		}

		Extension (applic = "Blender", type = "AS/pitch")
		{
			float {0.9}
		}

		Extension (applic = "Blender", type = "AS/dist_max")
		{
			float {10.0}
		}

		Extension (applic = "Blender", type = "AS/dist_ref")
		{
			float {0.5}
		}

		Extension (applic = "Blender", type = "AS/cone")
		{
			float[2] {{180.0, 95.0}}

			Extension (applic = "Blender", type = "AS/gain_outer")
			{
				float {0.8}
			}
		}
	}
}

AudioSource

This extension contains all attributes of an audio source. Only nodes will contain this extension structure. AS in the following extensions is short for audio source.

Substructures: 1 optional string primitive which represents a filepath to an audio file.

AS/gain

Substructures: 1 float primitive.

Default: 1.0

gain matches blenders speaker.volume property.

AS/pitch

Substructures: 1 float primitive.

Default: 1.0

The pitch of the sound source.

AS/gain_min

Substructures: 1 float primitive.

Default: 0.0

The minimum volume/gain of the sound source.

AS/gain_max

Substructures: 1 float primitive.

Default: 1.0

The maximum volume/gain of the sound source.

AS/rolloff

Substructures: 1 float primitive.

Default: 1.0

The rolloff of the sound source. Matches blenders speaker.attenuation properties.

AS/dist_max

Substructures: 1 float primitive.

Default: 1.0

The maximum distance of the sound source.

AS/dist_ref

Substructures: 1 float primitive.

Default: 1.0

Distance at which the volume of the sound source is 100%.

AS/cone

Substructures: optional 1 float[2] primitive. First component matching outer angle, second matching inner angle. And an optional AS/gain_outer.

Default: {360.0, 360.0}

Cone properties of the sound source.

AS/gain_outer

Substructures: 1 float primitive.

Default: 1.0

Volume outside the outer cone.