Starting VA API change adaption

parent dd77a633
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -10,37 +10,29 @@ va.connect( 'localhost' )
va.reset()
% Control output gain
va.setOutputGain( .25 )
va.set_output_gain( .25 )
% Add the current absolute folder path to VA application
va.addSearchPath( pwd );
va.add_search_path( pwd );
% Create a signal source and start playback
ita_write_wav( ita_demosound, 'ita_demosound.wav', 'overwrite' );
X = va.createAudiofileSignalSource( 'ita_demosound.wav' );
va.setAudiofileSignalSourcePlaybackAction( X, 'play' )
va.setAudiofileSignalSourceIsLooping( X, true );
X = va.create_signal_source_buffer_from_file( '$(DemoSound)' );
va.set_signal_source_buffer_playback_action( X, 'play' )
va.set_signal_source_buffer_looping( X, true );
% Create a virtual sound source and set a position
S = va.createSoundSource( 'itaVA_Source' );
va.setSoundSourcePosition( S, [0 1.7 -2] )
S = va.create_sound_source( 'itaVA_Source' );
va.set_sound_source_position( S, [ 2 1.7 2 ] )
% Connect the signal source to the virtual sound source
va.setSoundSourceSignalSource( S, X )
va.set_sound_source_signal_source( S, X )
% Create a listener with a HRTF and position him
H = va.loadHRIRDataset( '$(DefaultHRIR)' );
L = va.createListener( 'itaVA_Listener', 'default', H );
va.setListenerPosition( L, [0 1.7 0] )
va.setListenerOrientationYPR( L, [0 0 0] ) % Default view is to -Z (OpenGL)
L = va.create_sound_receiver( 'itaVA_Listener' );
va.set_sound_receiver_position( L, [ 0 1.7 0 ] )
% Set the listener as the active one
va.setActiveListener( L )
H = va.create_directivity( '$(DefaultHRIR)' );
va.set_sound_receiver_directivity( L, H );
% Now close connection
va.disconnect()
% VA virtual scene is still active now ...
% Explore itaVA class ...
doc itaVA
% More information
disp( 'Type ''doc itaVA'' for more information.' )
......@@ -2,20 +2,17 @@
% This assumes you already have set up a virtual scene without listener
% Create itaVA and connect
va = itaVA( 'localhost' )
va = itaVA( 'localhost' );
% Create a listener
L = va.createListener( 'itaVA_Tracked_Listener' );
% Create a sound receiver
L = va.create_sound_receiver( 'itaVA_Tracked_Listener' );
% OptiTrack tracker conneection and listener updates
va.setTrackedListener( L ) % For virtual scene / rendering
va.setTrackedRealWorldListener( L ) % For CTC reproductions
va.connectTracker
pause( 12 ) % Observe how you can move the virtual listener in VAGUI
va.disconnectTracker
% OptiTrack tracker conneection and sound receiver updates
va.set_tracked_sound_receiver( L ) % For virtual scene / rendering
va.set_tracked_real_world_sound_receiver( L ) % For CTC reproductions
va.connect_tracker
pause( 12 ) % Observe how you can move the virtual sound receiver
va.disconnect_tracker
% Remove listener again
va.deleteListener( L )
% Now close connection
va.disconnect()
va.delete_sound_receiver( L )
......@@ -83,8 +83,9 @@ if ~isempty( current_va_server_dir )
for i = 1:numel( vs )
vss = vs{ 1, i };
if numel( vss ) > 6
if strcmpi( vss( 1:6 ), 'VACore' )
set( handles.edit_vaserver_version, 'String', strcat( vs( i ) ) )
if strcmpi( vss( 3:10 ), 'VAServer' )
server_version = vss( 15:end );
set( handles.edit_vaserver_version, 'String', strcat( server_version ) )
end
end
end
......
itaVAq;
va.reset;
va.setOutputGain( .25 );
va.addSearchPath( pwd );
ita_write_wav( ita_demosound, 'ita_demosound.wav', 'overwrite' );
X = va.createAudiofileSignalSource( 'ita_demosound.wav' );
va.setAudiofileSignalSourcePlaybackAction( X, 'play' )
va.setAudiofileSignalSourceIsLooping( X, true );
S = va.createSoundSource( 'itaVA_Source', 'all' );
va.setSoundSourcePosition( S, [ 0 1.7 -2 ] );
va.setSoundSourceSignalSource( S, X );
H = va.loadHRIRDataset( '$(DefaultHRIR)' );
L = va.createListener( 'itaVA_Listener', 'all', H );
va.setListenerPosition( L, [ 0 1.7 0 ] );
va.setActiveListener( L );
\ No newline at end of file
......@@ -2,4 +2,4 @@
va = itaVA( 'localhost' );
%% Also add current dir to VA search path
va.addSearchPath( pwd );
\ No newline at end of file
va.add_search_path( pwd );
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment