Adding audio sample test with SRC

parent 17568746
......@@ -45,6 +45,12 @@ void CITAAudioSample::LoadWithSampleTypeConversion( const std::string& sFilePath
Load( sfRaw, GetSampleRate() );
}
void CITAAudioSample::Load( const CITAAudioSample& oSource )
{
Load( oSource, oSource.GetSampleRate() );
}
float CITAAudioSample::GetSampleRate() const
{
return m_fSampleRate;
......
......@@ -32,6 +32,20 @@ if( ITA_BASE_WITH_SNDFILE )
endif( )
if( ITA_BASE_WITH_SAMPLERATE )
add_executable( ITABaseAudioSampleTest ITABaseAudioSampleTest.cpp )
target_link_libraries( ITABaseAudioSampleTest ${VISTA_USE_PACKAGE_LIBRARIES} )
vista_configure_app( ITABaseAudioSampleTest )
vista_install( ITABaseAudioSampleTest )
vista_create_default_info_file( ITABaseAudioSampleTest )
set_property( TARGET ITABaseAudioSampleTest PROPERTY FOLDER "ITACoreLibs/Tests/ITABase" )
endif( )
add_executable( ITABaseSpectrumTests ITABaseSpectrumTests.cpp )
target_link_libraries( ITABaseSpectrumTests ${VISTA_USE_PACKAGE_LIBRARIES} )
......
#include <ITAException.h>
#include <ITAAudioSample.h>
#include <iostream>
using namespace std;
int main( int, char** )
{
try
{
CITAAudioSample as44kfs;
CITAAudioSample as48kfs;
CITAAudioSample as96kfs;
CITAAudioSample as128kfs;
as44kfs.Init( 2, 2 * 44100, 44.1e3, true );
as44kfs[ 0 ][ 0 ] = 1.0f;
as44kfs[ 0 ][ as44kfs.GetLength() - 1 ] = -1.0f;
as48kfs.Load( as44kfs );
as96kfs.Load( as48kfs );
as128kfs.Load( as96kfs );
}
catch( ITAException& err )
{
cerr << "Error: " << err << endl;
}
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment