diff --git a/examples/jupyter/va_notebook_example.ipynb b/examples/jupyter/va_notebook_example.ipynb index 8c76775c08d8159e6683895642f773f3704217e6..41c2c990985bdb8568099312d202138a3547a50d 100644 --- a/examples/jupyter/va_notebook_example.ipynb +++ b/examples/jupyter/va_notebook_example.ipynb @@ -12,32 +12,11 @@ }, { "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "['',\n", - " 'c:\\\\users\\\\jonas\\\\appdata\\\\local\\\\programs\\\\python\\\\python36\\\\python36.zip',\n", - " 'c:\\\\users\\\\jonas\\\\appdata\\\\local\\\\programs\\\\python\\\\python36\\\\DLLs',\n", - " 'c:\\\\users\\\\jonas\\\\appdata\\\\local\\\\programs\\\\python\\\\python36\\\\lib',\n", - " 'c:\\\\users\\\\jonas\\\\appdata\\\\local\\\\programs\\\\python\\\\python36',\n", - " 'c:\\\\users\\\\jonas\\\\appdata\\\\local\\\\programs\\\\python\\\\python36\\\\lib\\\\site-packages',\n", - " 'c:\\\\users\\\\jonas\\\\appdata\\\\local\\\\programs\\\\python\\\\python36\\\\lib\\\\site-packages\\\\IPython\\\\extensions',\n", - " 'C:\\\\Users\\\\jonas\\\\.ipython',\n", - " '../../../build_win32-x64.vc14/python/Lib/site-packages',\n", - " '../../../build_win32-x64.vc14/python/Lib/site-packages',\n", - " 'C:\\\\dev\\\\VA\\\\dist\\\\win32-x64.vc14\\\\python\\\\Lib\\\\site-packages',\n", - " '../../../build_win32-x64.vc14/python/Lib/site-packages',\n", - " 'C:\\\\dev\\\\VA\\\\dist\\\\win32-x64.vc14\\\\python\\\\Lib\\\\site-packages']" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], + "execution_count": null, + "metadata": { + "scrolled": false + }, + "outputs": [], "source": [ "import sys\n", "sys.path.append( \"../Lib/site-packages\" )\n", @@ -46,8 +25,10 @@ }, { "cell_type": "code", - "execution_count": 6, - "metadata": {}, + "execution_count": null, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "import va" @@ -57,83 +38,53 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "We start by adding finding out where we are currently working and list the files available, i.e. to load them as HRIR, audio file or directivity.\n" + "Ok. Now let's try to connect to a VA server running on the local machine. Remark: this local machine will be the one where this server jupyter notebook is running, not necessarily your PC." ] }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "working directory: C:\\dev\\VA\\VAPython\\examples\\jupyter_notebook\n" - ] - }, - { - "data": { - "text/plain": [ - "['.ipynb_checkpoints', 'VA notebook test.ipynb']" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "import os\n", - "current_working_dir = os.getcwd()\n", - "print( \"working directory: \" + current_working_dir )\n", - "os.listdir( current_working_dir )" + "va.connect( \"localhost\" ) # default port is: 12340; can be given as second parameter" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "Now lets add this folder to VA. This means that VA can find files that reside in this location. We first have to import va, though:" + "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", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ - "va.add_search_path( current_working_dir )" + "import os\n", + "current_working_dir = os.getcwd()\n", + "print( \"working directory: \" + current_working_dir )\n", + "os.listdir( current_working_dir )" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "Ok. Now let's try to connect to a VA server running on the local machine. Remark: this local machine will be the one where this server jupyter notebook is running, not necessarily your PC." + "Now lets add this folder to VA. This means that VA can find files that reside in this location, all you have to use is the file name (or a relative path from the base path you have added as search path)." ] }, { "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [ - { - "ename": "NameError", - "evalue": "name 'va' is not defined", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mva\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mconnect\u001b[0m\u001b[1;33m(\u001b[0m \u001b[1;34m\"localhost\"\u001b[0m \u001b[1;33m)\u001b[0m \u001b[1;31m# default port is: 12340; can be given as second parameter\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;31mNameError\u001b[0m: name 'va' is not defined" - ] - } - ], + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], "source": [ - "va.connect( \"localhost\" ) # default port is: 12340; can be given as second parameter" + "va.add_search_path( current_working_dir )" ] } ],