RedstartRunSimpleExample.h 1.6 KB
Newer Older
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
1 2 3 4 5 6
/*
 *  --------------------------------------------------------------------------------------------
 *
 *    VVV        VVV A           Virtual Acoustics (VA) | http://www.virtualacoustics.org
 *     VVV      VVV AAA          Licensed under the Apache License, Version 2.0
 *      VVV    VVV   AAA
7
 *       VVV  VVV     AAA        Copyright 2015-2019
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
 *        VVVVVV       AAA       Institute of Technical Acoustics (ITA)
 *         VVVV         AAA      RWTH Aachen University
 *
 *  --------------------------------------------------------------------------------------------
 */
#ifndef IW_REDSTART_RUN_SIMPLE_EXAMPLE
#define IW_REDSTART_RUN_SIMPLE_EXAMPLE

#include <VA.h>

inline void RunSimpleExample( IVAInterface* pVA )
{
	const std::string sSignalSourceID = pVA->CreateSignalSourceBufferFromFile( "$(DemoSound)" );
	pVA->SetSignalSourceBufferPlaybackAction( sSignalSourceID, IVAInterface::VA_PLAYBACK_ACTION_PLAY );
	pVA->SetSignalSourceBufferLooping( sSignalSourceID, true );

	const int iSoundSourceID = pVA->CreateSoundSource( "Redstart C++ example sound source" );
	pVA->SetSoundSourcePose( iSoundSourceID, VAVec3( 2.0f, 1.7f, 2.0f ), VAQuat( 0.0f, 0.0f, 0.0f, 1.0f ) );

	pVA->SetSoundSourceSignalSource( iSoundSourceID, sSignalSourceID );

	const int iHRIR = pVA->CreateDirectivityFromFile( "$(DefaultHRIR)" );

	const int iSoundReceiverID = pVA->CreateSoundReceiver( "Redstart C++ example sound receiver" );
	pVA->SetSoundReceiverPose( iSoundReceiverID, VAVec3( 0.0f, 1.7f, 0.0f ), VAQuat( 0.0f, 0.0f, 0.0f, 1.0f ) );
	pVA->SetSoundReceiverDirectivity( iSoundReceiverID, iHRIR );
};

#endif // IW_REDSTART_RUN_SIMPLE_EXAMPLE