"\u001b[1;32m<ipython-input-3-9508d0d3eded>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mva\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[1;31mImportError\u001b[0m: DLL load failed: Das angegebene Modul wurde nicht gefunden."
]
}
],
"outputs": [],
"source": [
"import va"
]
...
...
@@ -73,9 +60,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"connection_status = va.connect()"
...
...
@@ -91,9 +76,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"connected = va.is_connected()\n",
...
...
@@ -113,9 +96,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"if not connected :\n",
...
...
@@ -125,9 +106,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"import os\n",
...
...
@@ -145,9 +124,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"va.add_search_path( current_working_dir )"
...
...
@@ -156,23 +133,32 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"vamods = va.enumerate_modules()\n",
"vamods = va.get_modules()\n",
"print( vamods )"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
"metadata": {},
"outputs": [],
"source": [
"hw = va.get_hardware_configuration()\n",
"print( hw )"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
"source": [
"core_conf = va.get_core_configuration()\n",
"print( core_conf )"
]
}
],
"metadata": {
...
...
%% Cell type:markdown id: tags:
# VA notebook test
This is a simple test program that demonstrates the use of the VA Python binding within a jupyter notebook environment.
## Before we start
Before we start scripting, let's make VA available for us. If it is not installed and available from everywhere, this is how you can add the `va` module folder:
ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.
%% Cell type:markdown id: tags:
Ok. Now let's try to connect to the VA server that should be running on the same computer where this jupyter notebook is running.
%% Cell type:markdown id: tags:
We start by finding out where we are currently working and list the files available, i.e. to identify files that can be used as HRIR, audio file or directivity.
%% Cell type:code id: tags:
``` python
connection_status=va.connect()
```
%% Cell type:markdown id: tags:
We can check the connection by the following line
%% Cell type:code id: tags:
``` python
connected=va.is_connected()
ifconnected:
print("VA connection ready!")
else:
print("Something went wrong.")
```
%% Cell type:markdown id: tags:
... and also use different server names and ports
%% Cell type:code id: tags:
``` python
ifnotconnected:
va.connect("localhost",12340)# these are the default arguments
```
%% Cell type:code id: tags:
``` python
importos
current_working_dir=os.getcwd()
print("working directory: "+current_working_dir)
```
%% Cell type:markdown id: tags:
Now lets add this folder to VA. This means that VA can find files that reside in this location. All you have to do is use a file name or a relative path from this base path. You can add as much folders as you like.