Commit 29cfc41d authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Starting VA API change adaption

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