"This is a simple example how to create a simple acoustic scene in VA using Python."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Prerequisites\n",
"You can ignore this part, it is for preparation purposes only."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import sys\n",
"sys.path.append( '../../Lib/site-packages' )\n",
"import os\n",
"print( 'Current working directory:', os.getcwd() )\n",
"import va\n",
"print( 'Successfully loaded VA Python extension')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Connect"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"va.connect( \"localhost\" );"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Reset VA to clear the scene"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"va.reset()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Control output gain"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"va.set_output_gain( 0.25 )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Add the current working directory or any other relative or absolute directory as a search path to your VA application. From now on, only use relative paths or macros to paths.\n",
"> Pathes are relevant on server side, not on a remote client. The files must be available on the computer **where the VA application is running**!"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"va.add_search_path( os.getcwd() );"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Signal source\n",
"Create a signal source from a file and start playback with looping mode"