Skip to content
Snippets Groups Projects
Commit 0c566b71 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Portaudio measurement test tweaks

parent a5416e73
Branches
Tags
No related merge requests found
...@@ -36,7 +36,7 @@ set_property( TARGET ITAPortaudioInterfaceTest PROPERTY FOLDER "ITATests/ITAData ...@@ -36,7 +36,7 @@ set_property( TARGET ITAPortaudioInterfaceTest PROPERTY FOLDER "ITATests/ITAData
add_executable( ITAPortaudioMeasurementTest ITAPortaudioMeasurementTest.cpp ) add_executable( ITAPortaudioMeasurementTest ITAPortaudioMeasurementTest.cpp )
target_link_libraries( ITAPortaudioMeasurementTest ${VISTA_USE_PACKAGE_LIBRARIES} ) target_link_libraries( ITAPortaudioMeasurementTest ${VISTA_USE_PACKAGE_LIBRARIES} )
vista_set_target_msvc_arguments( ITAPortaudioMeasurementTest "${CMAKE_CURRENT_SOURCE_DIR}/ITAPortaudioInterfaceMeasurement_ExcitationSignal.wav ${CMAKE_CURRENT_SOURCE_DIR}/ITAPortaudioInterfaceMeasurement_Record.wav 44100 512" ) vista_set_target_msvc_arguments( ITAPortaudioMeasurementTest "${CMAKE_CURRENT_SOURCE_DIR}/ITAPortaudioMeasurement_ExcitationSignal.wav ${CMAKE_CURRENT_SOURCE_DIR}/ITAPortaudioMeasurement_Record.wav 44100 512" )
vista_configure_app( ITAPortaudioMeasurementTest ) vista_configure_app( ITAPortaudioMeasurementTest )
vista_install( ITAPortaudioMeasurementTest ) vista_install( ITAPortaudioMeasurementTest )
......
...@@ -15,6 +15,8 @@ int main( int argc, char *argv[] ) ...@@ -15,6 +15,8 @@ int main( int argc, char *argv[] )
if( argc != 5 ) if( argc != 5 )
ITA_EXCEPT1( INVALID_PARAMETER, "Syntax error: ITAPortaudioMeasurementTest.exe excitation.wav recording.wav samplerate blocklength" ); ITA_EXCEPT1( INVALID_PARAMETER, "Syntax error: ITAPortaudioMeasurementTest.exe excitation.wav recording.wav samplerate blocklength" );
try
{
std::string sExcitationSignalPath = std::string( argv[ 1 ] ); std::string sExcitationSignalPath = std::string( argv[ 1 ] );
std::string sRecordingSignalPath = std::string( argv[ 2 ] ); std::string sRecordingSignalPath = std::string( argv[ 2 ] );
double dSampleRate = StringToDouble( std::string( argv[ 3 ] ) ); double dSampleRate = StringToDouble( std::string( argv[ 3 ] ) );
...@@ -25,7 +27,7 @@ int main( int argc, char *argv[] ) ...@@ -25,7 +27,7 @@ int main( int argc, char *argv[] )
int iInputDevice = ITAPA_IN.GetDefaultInputDevice();; int iInputDevice = ITAPA_IN.GetDefaultInputDevice();;
ITAPA_IN.Initialize( iInputDevice ); ITAPA_IN.Initialize( iInputDevice );
std::string sInDevice = ITAPA_IN.GetDeviceName( iInputDevice ); std::string sInDevice = ITAPA_IN.GetDeviceName( iInputDevice );
std::cout << sInDevice << std::endl; std::cout << "Input device identifier: " << sInDevice << endl;
int iNumInputChannels, temp; int iNumInputChannels, temp;
ITAPA_IN.GetNumChannels( iInputDevice, iNumInputChannels, temp ); ITAPA_IN.GetNumChannels( iInputDevice, iNumInputChannels, temp );
...@@ -40,7 +42,7 @@ int main( int argc, char *argv[] ) ...@@ -40,7 +42,7 @@ int main( int argc, char *argv[] )
int iOutputDevice = ITAPA_OUT.GetDefaultOutputDevice();; int iOutputDevice = ITAPA_OUT.GetDefaultOutputDevice();;
ITAPA_OUT.Initialize( iOutputDevice ); ITAPA_OUT.Initialize( iOutputDevice );
std::string sOutDevice = ITAPA_OUT.GetDeviceName( iOutputDevice ); std::string sOutDevice = ITAPA_OUT.GetDeviceName( iOutputDevice );
std::cout << sOutDevice << std::endl; std::cout << "Output device identifier: " << sOutDevice << endl;
int iNumOutputChannels; int iNumOutputChannels;
ITAPA_OUT.GetNumChannels( iOutputDevice, temp, iNumOutputChannels ); ITAPA_OUT.GetNumChannels( iOutputDevice, temp, iNumOutputChannels );
...@@ -67,6 +69,11 @@ int main( int argc, char *argv[] ) ...@@ -67,6 +69,11 @@ int main( int argc, char *argv[] )
ITAPA_IN.Stop(); ITAPA_IN.Stop();
ITAPA_IN.Close(); ITAPA_IN.Close();
ITAPA_IN.Finalize(); ITAPA_IN.Finalize();
}
catch( const ITAException& e )
{
cerr << e << endl;
}
return 0; return 0;
} }
\ No newline at end of file
sweep = ita_generate_sweep; sweep_raw = ita_generate_sweep;
ita_write_wav( sweep, 'ITAPortaudioInterfaceMeasurement_ExcitationSignal.wav', 'nBits', 32 ); sweep_2ch = ita_merge( sweep_raw * 0.1, sweep_raw * 0 );
ita_write_wav( sweep_2ch, 'ITAPortaudioMeasurement_ExcitationSignal.wav', 'nBits', 32, 'overwrite' );
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment