MCPcopy Create free account
hub / github.com/cinder/Cinder / SpectralTest

Method SpectralTest

test/_audio/AudioTests/src/SpectralTest.cpp:21–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19namespace im = ImGui;
20
21SpectralTest::SpectralTest()
22{
23 mSubTests = {
24 "sine",
25 "sine (no output)",
26 "sample",
27 };
28
29 auto ctx = audio::master();
30
31 auto format = audio::MonitorSpectralNode::Format().fftSize( FFT_SIZE ).windowSize( WINDOW_SIZE ).windowType( WINDOW_TYPE );
32 mMonitorSpectralNode = ctx->makeNode( new audio::MonitorSpectralNode( format ) );
33 mMonitorSpectralNode->setAutoEnabled();
34
35 mGen = ctx->makeNode( new audio::GenSineNode() );
36 //mGen = ctx->makeNode( new audio::GenTriangleNode() );
37 mGen->setFreq( 440.0f );
38
39 mSourceFile = audio::load( app::loadAsset( "tone440L220R.mp3" ), ctx->getSampleRate() );
40
41 mGain = ctx->makeNode( new audio::GainNode() );
42 mGain->setValue( 0.6f );
43
44 auto audioBuffer = mSourceFile->loadBuffer();
45 CI_LOG_V( "loaded source buffer, frames: " << audioBuffer->getNumFrames() );
46
47 mPlayerNode = ctx->makeNode( new audio::BufferPlayerNode( audioBuffer ) );
48
49 setupSubTest( "sine" );
50
51 CI_LOG_V( "MonitorSpectralNode fftSize: " << mMonitorSpectralNode->getFftSize() << ", windowSize: " << mMonitorSpectralNode->getWindowSize() );
52}
53
54void SpectralTest::setupSubTest( const string &testName )
55{

Callers

nothing calls this directly

Calls 11

masterFunction · 0.85
loadFunction · 0.85
loadAssetFunction · 0.85
makeNodeMethod · 0.80
getFftSizeMethod · 0.80
FormatClass · 0.50
getSampleRateMethod · 0.45
setValueMethod · 0.45
loadBufferMethod · 0.45
getNumFramesMethod · 0.45
getWindowSizeMethod · 0.45

Tested by

no test coverage detected