Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VAUnity
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Institute of Technical Acoustics (ITA)
VAUnity
Commits
aa4c734c
Commit
aa4c734c
authored
Dec 16, 2016
by
Maurice Tayeb Andreas
Browse files
Options
Downloads
Patches
Plain Diff
[VAU]
AuralizationMode Event von aussen
parent
88f4d102
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
VACS.cs
+8
-9
8 additions, 9 deletions
VACS.cs
VAUAdapter.cs
+4
-4
4 additions, 4 deletions
VAUAdapter.cs
VAUAuralizationMode.cs
+22
-0
22 additions, 0 deletions
VAUAuralizationMode.cs
VAUListener.cs
+2
-2
2 additions, 2 deletions
VAUListener.cs
VAUSoundSource.cs
+4
-3
4 additions, 3 deletions
VAUSoundSource.cs
with
40 additions
and
18 deletions
VACS.cs
+
8
−
9
View file @
aa4c734c
...
@@ -22,13 +22,15 @@ namespace VA
...
@@ -22,13 +22,15 @@ namespace VA
public
bool
Connect
()
public
bool
Connect
()
{
{
bool
b
=
NativeConnectLocalNetClient
(
_NetClient
);
bool
b
=
NativeConnectLocalNetClient
(
_NetClient
);
Debug
.
Assert
(
b
,
"
No
t
C
onnect
ed
to VA."
);
Debug
.
Assert
(
b
,
"
Couldn'
t
c
onnect to VA."
);
return
b
;
return
b
;
}
}
public
bool
Connect
(
string
HostIP
,
int
Port
)
public
bool
Connect
(
string
HostIP
,
int
Port
)
{
{
return
NativeConnectNetClient
(
_NetClient
,
HostIP
,
Port
);
bool
b
=
NativeConnectNetClient
(
_NetClient
,
HostIP
,
Port
);
Debug
.
Assert
(
b
,
"[VAU]Couldn't connect to VA."
);
return
b
;
}
}
public
bool
IsConnected
()
public
bool
IsConnected
()
...
@@ -49,12 +51,9 @@ namespace VA
...
@@ -49,12 +51,9 @@ namespace VA
/**
/**
* Create a listener (returns ID)
* Create a listener (returns ID)
*/
*/
public
int
CreateListener
(
string
Name
,
int
AuraMode
,
int
HRIR
)
public
int
CreateListener
(
string
Name
)
{
{
if
(!
IsConnected
())
return
NativeCreateListener
(
_NetClient
,
Name
);
return
-
1
;
return
NativeCreateListener
(
_NetClient
,
Name
,
AuraMode
,
HRIR
);
}
}
public
void
SetListenerPosition
(
int
Listener
,
double
x
,
double
y
,
double
z
)
public
void
SetListenerPosition
(
int
Listener
,
double
x
,
double
y
,
double
z
)
...
@@ -99,7 +98,7 @@ namespace VA
...
@@ -99,7 +98,7 @@ namespace VA
{
{
int
b
=
NativeLoadHRIRDataset
(
_NetClient
,
FilePath
,
Name
);
int
b
=
NativeLoadHRIRDataset
(
_NetClient
,
FilePath
,
Name
);
Debug
.
Assert
(
b
!=
-
1
);
Debug
.
Assert
(
b
!=
-
1
,
"[VAU]HRIRDataset konnte nicht geladen werden."
);
return
b
;
return
b
;
}
}
...
@@ -371,7 +370,7 @@ namespace VA
...
@@ -371,7 +370,7 @@ namespace VA
double
dUpX
,
double
dUpY
,
double
dUpZ
,
double
dUpX
,
double
dUpY
,
double
dUpZ
,
double
dVelocityX
,
double
dVelocityY
,
double
dVelocityZ
);
double
dVelocityX
,
double
dVelocityY
,
double
dVelocityZ
);
//[ DllImport( "VANetCSWrapper" ) ] private static extern void NativeGetListenerIDs( IntPtr pClient, std::vector<int>& vListenerIDs );
//[ DllImport( "VANetCSWrapper" ) ] private static extern void NativeGetListenerIDs( IntPtr pClient, std::vector<int>& vListenerIDs );
[
DllImport
(
"VANetCSWrapper"
)
]
private
static
extern
int
NativeCreateListener
(
IntPtr
pClient
,
string
sName
,
int
iAuralizationMode
,
int
iHRIRDatasetID
);
[
DllImport
(
"VANetCSWrapper"
)
]
private
static
extern
int
NativeCreateListener
(
IntPtr
pClient
,
string
sName
);
[
DllImport
(
"VANetCSWrapper"
)
]
private
static
extern
int
NativeCreateListenerExplicitRenderer
(
IntPtr
pClient
,
string
sName
,
string
sRendererID
);
[
DllImport
(
"VANetCSWrapper"
)
]
private
static
extern
int
NativeCreateListenerExplicitRenderer
(
IntPtr
pClient
,
string
sName
,
string
sRendererID
);
[
DllImport
(
"VANetCSWrapper"
)
]
private
static
extern
void
NativeSetActiveListenerExplicitRenderer
(
IntPtr
pClient
,
int
iListenerID
,
string
sRendererID
);
[
DllImport
(
"VANetCSWrapper"
)
]
private
static
extern
void
NativeSetActiveListenerExplicitRenderer
(
IntPtr
pClient
,
int
iListenerID
,
string
sRendererID
);
[
DllImport
(
"VANetCSWrapper"
)
]
private
static
extern
int
NativeGetActiveListenerExplicitRenderer
(
IntPtr
pClient
,
string
sRendererID
);
[
DllImport
(
"VANetCSWrapper"
)
]
private
static
extern
int
NativeGetActiveListenerExplicitRenderer
(
IntPtr
pClient
,
string
sRendererID
);
...
...
This diff is collapsed.
Click to expand it.
VAUAdapter.cs
+
4
−
4
View file @
aa4c734c
...
@@ -45,10 +45,10 @@ public class VAUAdapter : MonoBehaviour {
...
@@ -45,10 +45,10 @@ public class VAUAdapter : MonoBehaviour {
defaulthrir
=
_VA
.
LoadHRIRDataset
(
DefaultHRIRPath
,
"DefaultHRIR"
);
defaulthrir
=
_VA
.
LoadHRIRDataset
(
DefaultHRIRPath
,
"DefaultHRIR"
);
defaultdirectivity
=
_VA
.
LoadDirectivity
(
DefaultDirectivityPath
,
"DefaultDirectivity"
);
defaultdirectivity
=
_VA
.
LoadDirectivity
(
DefaultDirectivityPath
,
"DefaultDirectivity"
);
_VA
.
SetGlobalAuralizationMode
(
GlobalAuralizationMode
);
_VA
.
SetGlobalAuralizationMode
(
GlobalAuralizationMode
);
Debug
.
Log
(
"Connect to Server: "
+
HostIP
);
Debug
.
Log
(
"
[VAU]
Connect to Server: "
+
HostIP
);
}
}
else
else
Debug
.
Log
(
"Already connected."
);
Debug
.
Log
(
"
[VAU]
Already connected."
);
}
}
public
static
int
DefaultHRIR
public
static
int
DefaultHRIR
...
@@ -93,14 +93,14 @@ public class VAUAdapter : MonoBehaviour {
...
@@ -93,14 +93,14 @@ public class VAUAdapter : MonoBehaviour {
VAUSoundSource
[]
SoundSources
=
FindObjectsOfType
<
VAUSoundSource
>();
VAUSoundSource
[]
SoundSources
=
FindObjectsOfType
<
VAUSoundSource
>();
foreach
(
VAUSoundSource
SoundSource
in
SoundSources
)
foreach
(
VAUSoundSource
SoundSource
in
SoundSources
)
{
{
Debug
.
Log
(
"SoundSouce "
+
SoundSource
.
ID
+
" deleted."
);
Debug
.
Log
(
"
[VAU]
SoundSouce "
+
SoundSource
.
ID
+
" deleted."
);
_VA
.
DeleteSoundSource
(
SoundSource
.
ID
);
_VA
.
DeleteSoundSource
(
SoundSource
.
ID
);
}
}
VAUListener
[]
Listeners
=
FindObjectsOfType
<
VAUListener
>();
VAUListener
[]
Listeners
=
FindObjectsOfType
<
VAUListener
>();
foreach
(
VAUListener
Listener
in
Listeners
)
foreach
(
VAUListener
Listener
in
Listeners
)
{
{
Debug
.
Log
(
"Listener "
+
Listener
.
ID
+
" deleted."
);
Debug
.
Log
(
"
[VAU]
Listener "
+
Listener
.
ID
+
" deleted."
);
_VA
.
DeleteListener
(
Listener
.
ID
);
_VA
.
DeleteListener
(
Listener
.
ID
);
}
}
if
(
GetComponent
<
VAUAuralizationMode
>()
!=
null
)
if
(
GetComponent
<
VAUAuralizationMode
>()
!=
null
)
...
...
This diff is collapsed.
Click to expand it.
VAUAuralizationMode.cs
+
22
−
0
View file @
aa4c734c
...
@@ -159,6 +159,28 @@ public class VAUAuralizationMode : MonoBehaviour {
...
@@ -159,6 +159,28 @@ public class VAUAuralizationMode : MonoBehaviour {
public
void
TriggerAuraStringChanged
(
string
externAuraString
)
public
void
TriggerAuraStringChanged
(
string
externAuraString
)
{
{
if
(
externAuraString
==
"+DS"
)
DirectSound
=
true
;
if
(
externAuraString
==
"-DS"
)
DirectSound
=
false
;
if
(
externAuraString
==
"+ER"
)
EarlyReflections
=
true
;
if
(
externAuraString
==
"-ER"
)
EarlyReflections
=
false
;
if
(
externAuraString
==
"+DD"
)
DiffuseDecay
=
true
;
if
(
externAuraString
==
"-DD"
)
DiffuseDecay
=
false
;
if
(
externAuraString
==
"+DIR"
)
SourceDirectivity
=
true
;
if
(
externAuraString
==
"-DIR"
)
SourceDirectivity
=
false
;
if
(
externAuraString
==
"+AA"
)
AirAbsorption
=
true
;
if
(
externAuraString
==
"-AA"
)
AirAbsorption
=
false
;
if
(
externAuraString
==
"+TV"
)
AtmosphericTemporalVariations
=
true
;
if
(
externAuraString
==
"-TV"
)
AtmosphericTemporalVariations
=
false
;
if
(
externAuraString
==
"+SC"
)
Scattering
=
true
;
if
(
externAuraString
==
"-SC"
)
Scattering
=
false
;
if
(
externAuraString
==
"+DIF"
)
Diffraction
=
true
;
if
(
externAuraString
==
"-DIF"
)
Diffraction
=
false
;
if
(
externAuraString
==
"+NF"
)
NearFielEffects
=
true
;
if
(
externAuraString
==
"-NF"
)
NearFielEffects
=
false
;
if
(
externAuraString
==
"+DP"
)
DopplerShifts
=
true
;
if
(
externAuraString
==
"-DP"
)
DopplerShifts
=
false
;
if
(
externAuraString
==
"+SL"
)
SphericalSpreadingLoss
=
true
;
if
(
externAuraString
==
"-SL"
)
SphericalSpreadingLoss
=
false
;
AuraStringChanged
(
externAuraString
);
AuraStringChanged
(
externAuraString
);
}
}
AuralizationMode
UpdateAuraModeSettings
()
AuralizationMode
UpdateAuraModeSettings
()
...
...
This diff is collapsed.
Click to expand it.
VAUListener.cs
+
2
−
2
View file @
aa4c734c
...
@@ -29,10 +29,10 @@ public class VAUListener : MonoBehaviour {
...
@@ -29,10 +29,10 @@ public class VAUListener : MonoBehaviour {
void
Start
()
void
Start
()
{
{
_VA
=
VAUAdapter
.
VA
;
_VA
=
VAUAdapter
.
VA
;
Listener
=
_VA
.
CreateListener
(
listenername
,
0
,
VAUAdapter
.
DefaultHRIR
);
Listener
=
_VA
.
CreateListener
(
listenername
);
listenername
+=
" "
+
Listener
;
listenername
+=
" "
+
Listener
;
_VA
.
SetListenerAuralizationMode
(
Listener
,
"all"
);
_VA
.
SetListenerAuralizationMode
(
Listener
,
"all"
);
Debug
.
Log
(
listenername
+
" created"
);
Debug
.
Log
(
"[VAU]"
+
listenername
+
" created"
);
_VA
.
SetListenerHRIRDataset
(
Listener
,
VAUAdapter
.
DefaultHRIR
);
_VA
.
SetListenerHRIRDataset
(
Listener
,
VAUAdapter
.
DefaultHRIR
);
SetListenerPositionOrientation
();
SetListenerPositionOrientation
();
_VA
.
SetArtificalReverbarationTime
(
VAAudioRenderer
,
2
);
_VA
.
SetArtificalReverbarationTime
(
VAAudioRenderer
,
2
);
...
...
This diff is collapsed.
Click to expand it.
VAUSoundSource.cs
+
4
−
3
View file @
aa4c734c
...
@@ -48,6 +48,7 @@ public class VAUSoundSource : MonoBehaviour {
...
@@ -48,6 +48,7 @@ public class VAUSoundSource : MonoBehaviour {
directivity
=
VAUAdapter
.
DefaultDirectivity
;
directivity
=
VAUAdapter
.
DefaultDirectivity
;
else
else
directivity
=
_VA
.
LoadDirectivity
(
directivitypath
,
"SoundSource "
+
SoundSource
+
" Directivity"
);
directivity
=
_VA
.
LoadDirectivity
(
directivitypath
,
"SoundSource "
+
SoundSource
+
" Directivity"
);
_VA
.
SetSoundSourceDirectivity
(
SoundSource
,
directivity
);
if
(
GetComponent
<
AudioSource
>()
!=
null
)
if
(
GetComponent
<
AudioSource
>()
!=
null
)
{
{
...
@@ -55,15 +56,15 @@ public class VAUSoundSource : MonoBehaviour {
...
@@ -55,15 +56,15 @@ public class VAUSoundSource : MonoBehaviour {
{
{
SignalSource
=
_VA
.
CreateAudiofileSignalSource
(
AssetDatabase
.
GetAssetPath
(
GetComponent
<
AudioSource
>().
clip
),
this
.
name
+
"_signal"
);
SignalSource
=
_VA
.
CreateAudiofileSignalSource
(
AssetDatabase
.
GetAssetPath
(
GetComponent
<
AudioSource
>().
clip
),
this
.
name
+
"_signal"
);
_VA
.
SetSoundSourceSignalSource
(
SoundSource
,
SignalSource
);
_VA
.
SetSoundSourceSignalSource
(
SoundSource
,
SignalSource
);
Debug
.
Log
(
SignalSource
+
" connected to SoundSource "
+
SoundSource
);
Debug
.
Log
(
"[VAU]"
+
SignalSource
+
" connected to SoundSource "
+
SoundSource
);
_VA
.
SetAudiofileSignalSourcePlaybackAction
(
SignalSource
,
"PLAYING"
);
_VA
.
SetAudiofileSignalSourcePlaybackAction
(
SignalSource
,
"PLAYING"
);
_VA
.
SetAudiofileSignalSourceIsLooping
(
SignalSource
,
islooping
);
_VA
.
SetAudiofileSignalSourceIsLooping
(
SignalSource
,
islooping
);
}
}
else
else
Debug
.
Log
(
"No clip on AudioSource of GameObject: "
+
gameObject
.
name
);
Debug
.
Log
(
"
[VAU]
No clip on AudioSource of GameObject: "
+
gameObject
.
name
);
}
}
else
else
Debug
.
Log
(
"No AudioSource on GameObject: "
+
gameObject
.
name
);
Debug
.
Log
(
"
[VAU]
No AudioSource on GameObject: "
+
gameObject
.
name
);
if
(
GetComponent
<
VAUAuralizationMode
>()
!=
null
)
if
(
GetComponent
<
VAUAuralizationMode
>()
!=
null
)
{
{
GetComponent
<
VAUAuralizationMode
>().
AuraStringChanged
+=
OnSoundSourceAuralizationModeChanged
;
GetComponent
<
VAUAuralizationMode
>().
AuraStringChanged
+=
OnSoundSourceAuralizationModeChanged
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment