diff --git a/examples/va_example_simple.py b/examples/va_example_simple.py index 54c68dbd6a187c7085c70b12d52dd7535761ed6a..359e6735c8113717d9872914ee8733225310c0d3 100644 --- a/examples/va_example_simple.py +++ b/examples/va_example_simple.py @@ -9,24 +9,25 @@ current_exec_dir = os.getcwd() import va va.connect() # localhost +va.reset() va.add_search_path( current_exec_dir ) # add current working path to find any file lying around here -signal_source_id = va.create_signal_source_buffer_from_file( "Bauer.wav" ) # Provide this file or modify file name and use your own +signal_source_id = va.create_signal_source_buffer_from_file( 'Audiofiles/lang_short.wav' ) # Provide this file or modify file name and use your own -dir_id = va.load_directivity( "${DefaultDir}" ) +dir_id = va.create_directivity_from_file( '$(Trumpet)' ) -sound_source_id = va.create_sound_source( "PySoundSource" ) +sound_source_id = va.create_sound_source( 'PySoundSource' ) va.set_sound_source_signal_source( sound_source_id, signal_source_id ) -va.set_directivity( sound_source_id, dir_id ) +va.set_sound_source_directivity( sound_source_id, dir_id ) va.set_sound_source_position( sound_source_id, ( 1, 1.2, -1 ) ) # OpenGL axes convention, direction is lower front-right from listener pos (s.b.) -hrir_id = va.load_directivity( "${DefaultHRIR}" ) +hrir_id = va.create_directivity_from_file( '$(DefaultHRIR)' ) sound_receiver_id = va.create_sound_receiver( "PyListener" ) -va.set_sound_receiver_hrir( sound_receiver_id, hrir_id ) +va.set_sound_receiver_directivity( sound_receiver_id, hrir_id ) va.set_sound_receiver_position( sound_receiver_id, ( 0, 1.7, 0 ) ) # Ear height at 1.7m -va.set_signal_source_buffer_looping( signal_source_id, true ) -va.set_signal_source_buffer_playback_action( signal_source_id, "play" ) +va.set_signal_source_buffer_looping( signal_source_id, True ) +va.set_signal_source_buffer_playback_action_str( signal_source_id, 'play' ) va.disconnect() diff --git a/src/vasingletonmethods.hpp b/src/vasingletonmethods.hpp index 7a7975b53a3610fa3d39e467b1d15faa4f9187db..6d8b60fc6b5d05d3bc5bb0458a452a17c012ad0f 100644 --- a/src/vasingletonmethods.hpp +++ b/src/vasingletonmethods.hpp @@ -330,7 +330,7 @@ static PyObject* create_directivity_from_file( PyObject*, PyObject** ppArgs, Py_ return NULL; std::string sName = pcName ? std::string( pcName ) : ""; - return PyBool_FromLong( g_pVANetClient->GetCoreInstance()->CreateDirectivityFromFile( std::string( pcPath ), sName ) ); + return PyLong_FromLong( g_pVANetClient->GetCoreInstance()->CreateDirectivityFromFile( std::string( pcPath ), sName ) ); VAPY_CATCH_RETURN; };