Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
VAMatlab
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
VAMatlab
Commits
52075425
Commit
52075425
authored
Oct 06, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Progress
parent
19af8e22
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
19 deletions
+17
-19
matlab/itaVA_example_simple.m
matlab/itaVA_example_simple.m
+13
-13
src/VAMatlabConnection.cpp
src/VAMatlabConnection.cpp
+1
-1
src/VAMatlabExecutable.cpp
src/VAMatlabExecutable.cpp
+3
-5
No files found.
matlab/itaVA_example_simple.m
View file @
52075425
...
...
@@ -10,32 +10,32 @@ va.connect( 'localhost' )
va
.
reset
()
% Control output gain
va
.
set
OutputG
ain
(
.
25
)
va
.
set
_output_g
ain
(
.
25
)
% Add the current absolute folder path to VA application
va
.
add
SearchPath
(
pwd
);
va
.
add
_search_path
(
pwd
);
% Create a signal source and start playback
ita_write_wav
(
ita_demosound
,
'ita_demosound.wav'
,
'overwrite'
);
X
=
va
.
create
AudiofileSignalSourc
e
(
'ita_demosound.wav'
);
va
.
set
AudiofileSignalSourcePlaybackA
ction
(
X
,
'play'
)
va
.
set
AudiofileSignalSourceIsL
ooping
(
X
,
true
);
X
=
va
.
create
_signal_source_buffer_from_fil
e
(
'ita_demosound.wav'
);
va
.
set
_signal_source_buffer_playback_a
ction
(
X
,
'play'
)
va
.
set
_signal_source_buffer_l
ooping
(
X
,
true
);
% Create a virtual sound source and set a position
S
=
va
.
create
SoundS
ource
(
'itaVA_Source'
);
va
.
set
SoundSourceP
osition
(
S
,
[
0
1.7
-
2
]
)
S
=
va
.
create
_sound_s
ource
(
'itaVA_Source'
);
va
.
set
_sound_source_p
osition
(
S
,
[
0
1.7
-
2
]
)
% Connect the signal source to the virtual sound source
va
.
set
SoundSourceSignalS
ource
(
S
,
X
)
va
.
set
_sound_source_signal_s
ource
(
S
,
X
)
% Create a listener with a HRTF and position him
H
=
va
.
loadHRIRDataset
(
'$(DefaultHRIR)'
);
L
=
va
.
create
Listener
(
'itaVA_Listener'
,
'default'
,
H
);
va
.
set
ListenerPosition
(
L
,
[
0
1.7
0
]
)
va
.
set
ListenerOrientationYPR
(
L
,
[
0
0
0
]
)
% Default view is to -Z (OpenGL
)
H
=
va
.
create_directivity
(
'$(DefaultHRIR)'
);
L
=
va
.
create
_sound_receiver
(
'itaVA_Listener'
);
va
.
set
_sound_receiver_position
(
L
,
[
-
2
1.7
0
]
)
va
.
set
_sound_receiver_orientation_view_up
(
L
,
[
0
0
-
1
],
[
0
1
0
]
)
% Set the listener as the active one
va
.
set
ActiveListen
er
(
L
)
va
.
set
_active_sound_receiv
er
(
L
)
% Now close connection
va
.
disconnect
()
...
...
src/VAMatlabConnection.cpp
View file @
52075425
...
...
@@ -26,7 +26,7 @@ CVAMatlabConnection::CVAMatlabConnection()
CVAMatlabConnection
::~
CVAMatlabConnection
()
{
if
(
pVAMatlabTracker
->
Is
Connected
()
)
if
(
pVAMatlabTracker
->
Get
Connected
()
)
pVAMatlabTracker
->
Uninitialize
();
delete
pVAMatlabTracker
;
...
...
src/VAMatlabExecutable.cpp
View file @
52075425
...
...
@@ -331,7 +331,7 @@ void get_connected( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
}
CVAMatlabConnection
*
pConnection
=
g_vpConnections
[
hHandle
];
bool
bConnected
=
pConnection
->
pClient
->
Is
Connected
();
bool
bConnected
=
pConnection
->
pClient
->
Get
Connected
();
plhs
[
0
]
=
mxCreateLogicalScalar
(
bConnected
);
};
...
...
@@ -409,7 +409,7 @@ void connect( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
{
pConnection
->
pClient
->
Initialize
(
sAddress
,
iPort
,
IVANetClient
::
EXC_CLIENT_THROW
,
false
);
if
(
!
pConnection
->
pClient
->
Is
Connected
()
)
if
(
!
pConnection
->
pClient
->
Get
Connected
()
)
{
// TODO: Delete object. Here were some error with double destruction. Exception in destr?
std
::
stringstream
ss
;
...
...
@@ -595,7 +595,7 @@ void get_tracker_connected( int nlhs, mxArray *plhs[], int nrhs, const mxArray *
CVAMatlabConnection
*
pConnection
=
g_vpConnections
[
hHandle
];
CVAMatlabTracker
*
pTracker
=
pConnection
->
pVAMatlabTracker
;
bool
bIsConnected
=
pTracker
->
Is
Connected
();
bool
bIsConnected
=
pTracker
->
Get
Connected
();
if
(
nlhs
!=
1
)
{
if
(
bIsConnected
)
...
...
@@ -1905,7 +1905,6 @@ void set_sound_source_pose( int nlhs, mxArray *plhs[], int nrhs, const mxArray *
REGISTER_PUBLIC_FUNCTION
(
get_sound_receiver_ids
,
"Returns the IDs of all sound receivers in the scene"
,
""
);
DECLARE_FUNCTION_OUTARG
(
get_sound_receiver_ids
,
ids
,
"integer-1xN"
,
"Vector containing the IDs"
);
void
get_sound_receiver_ids
(
int
nlhs
,
mxArray
*
plhs
[],
int
nrhs
,
const
mxArray
*
prhs
[]
)
{
REQUIRE_INPUT_ARGS
(
1
);
...
...
@@ -1923,7 +1922,6 @@ void get_sound_receiver_ids( int nlhs, mxArray *plhs[], int nrhs, const mxArray
REGISTER_PUBLIC_FUNCTION
(
create_sound_receiver
,
"Creates a sound receiver"
,
""
);
DECLARE_FUNCTION_OPTIONAL_INARG
(
create_sound_receiver
,
name
,
"string"
,
"Displayed name"
,
"''"
);
DECLARE_FUNCTION_OUTARG
(
create_sound_receiver
,
id
,
"integer-1x1"
,
"Sound receiver ID"
);
void
create_sound_receiver
(
int
nlhs
,
mxArray
*
plhs
[],
int
nrhs
,
const
mxArray
*
prhs
[]
)
{
REQUIRE_INPUT_ARGS
(
2
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment