Heilan X3D Browser

Multithreaded Audio in Heilan

Heilan is able to process the audio from multiple nodes in parallel, making use of multiple audio threads (the aim being to hopefully improve efficiency on multiprocessor machines). The degree to which this occurs can be controlled by the scene author.

Heilan's parallelisation is controlled by ParentNodes. All ParentNodes in Heilan have a flag which may be turned on to split the audio from all of their child nodes into separate flags. This flag is turned off by default, but you may turn it on through the use of a MetadataString node, as follows:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE X3D>
<X3D profile="Full">
	<Scene>
		<MetadataString name="heilan_parallelChildren" value="TRUE"/>

		<NavigationInfo type="ANY"/>
		<Transform translation="-4.0 0.0 -8.0 ">
			<Sound>
				<AudioClip url="/home/niall/music/samples/thing.wav"/>
			</Sound>
		</Transform>

		<Transform translation="4.0 0.0 -8.0 ">
			<Sound>
				<AudioClip url="/home/niall/music/samples/thing.wav"/>
			</Sound>
		</Transform>
	</Scene>
</X3D>
		

In this example, The 'Scene' ParentNode has it's parallelChildren flag toggled 'TRUE', meaning that the two 'Transform' child nodes are each provided with a separate audio thread. Any children nodes of the 'Transform' nodes then process their audio in that 'Transform' node's thread. The following example demonstrates how you may have some nodes processed in parallel, and others not:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE X3D>
<X3D profile="Full">
	<Scene>
		<NavigationInfo type="ANY"/>

		<Transform translation="-4.0 0.0 -8.0 ">
			<Sound>
				<AudioClip url="/home/niall/music/samples/thing.wav"/>
			</Sound>
		</Transform>

		<Transform translation="4.0 0.0 -8.0 ">
			<Sound>
				<AudioClip url="/home/niall/music/samples/thing.wav"/>
			</Sound>
		</Transform>

		<Group>
			<MetadataString name="heilan_parallelChildren" value="TRUE"/>

			<Transform translation="-4.0 0.0 -8.0 ">
				<Sound>
					<AudioClip url="thing2.wav"/>
				</Sound>
			</Transform>

			<Transform translation="4.0 0.0 -8.0 ">
				<Sound>
					<AudioClip url="thing2.wav"/>
				</Sound>
			</Transform>
		</Group>
	</Scene>
</X3D>
		

Here we use a dummy 'Group' ParentNode to split the final two 'Sound' nodes into separate threads. The first two 'Sound' nodes are processed in the same thread.