Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
ITABase
Commits
9d390cf2
Commit
9d390cf2
authored
Jun 14, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Adding audio sample test with SRC
parent
17568746
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/ITAAudioSample.cpp
View file @
9d390cf2
...
...
@@ -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
;
...
...
tests/CMakeLists.txt
View file @
9d390cf2
...
...
@@ -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
}
)
...
...
tests/ITABaseAudioSampleTest.cpp
0 → 100644
View file @
9d390cf2
#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.0
f
;
as44kfs
[
0
][
as44kfs
.
GetLength
()
-
1
]
=
-
1.0
f
;
as48kfs
.
Load
(
as44kfs
);
as96kfs
.
Load
(
as48kfs
);
as128kfs
.
Load
(
as96kfs
);
}
catch
(
ITAException
&
err
)
{
cerr
<<
"Error: "
<<
err
<<
endl
;
}
return
0
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment