Commit 140f8c62 authored by Anne Heimes's avatar Anne Heimes
Browse files

Test mehr als 2 channel übertragen und im Stream zusammenfassen

parent 8a6fafc5
......@@ -18,28 +18,31 @@ static int g_iBufferSize = 1024;
int main( int , char** )
{
CITANetAudioStream oNetAudioStream( 10, g_dSampleRate, g_iBufferSize, 100 * g_iBufferSize );
ITAStreamProbe oProbe( &oNetAudioStream, "out_gutentag.wav" );
CITANetAudioStream oNetAudioStream( 20, g_dSampleRate, g_iBufferSize, 100 * g_iBufferSize );
ITAStreamPatchbay oPatchbay( g_dSampleRate, g_iBufferSize );
oPatchbay.AddInput( &oProbe );
oPatchbay.AddInput( &oNetAudioStream );
ITADatasource* pOutput;
oPatchbay.AddOutput( 1 );
for ( int n = 0; n<1; n++ )
/*
for ( int i = 0; i < oNetAudioStream.GetNumberOfChannels( ); i++ )
{
if ( oProbe.GetNumberOfChannels( ) > 1 )
oPatchbay.ConnectChannels( 0, n % ( oProbe.GetNumberOfChannels( ) - 1 ), 0, n );
if ( i % 2 == 0 )
oPatchbay.ConnectChannels( 0, i, 0, 0 );
else
oPatchbay.ConnectChannels( 0, 0, 0, n );
}
pOutput = oPatchbay.GetOutputDatasource( 0 );
std::cout << "NumOutChannel " << pOutput->GetNumberOfChannels() << std::endl;
oPatchbay.ConnectChannels( 0, i, 0, 1 );
*/
oPatchbay.ConnectChannels( 0, 0, 0, 0, 1.0f );
pOutput = oPatchbay.GetOutputDatasource( 0 );
ITAStreamMultiplier1N oMultiplier( pOutput, 2 );
ITAStreamProbe oProbe( pOutput, "output.wav" );
ITAStreamMultiplier1N oMultiplier( &oProbe, 2 );
ITAPortaudioInterface ITAPA( g_dSampleRate, g_iBufferSize );
ITAPA.Initialize();
ITAPA.SetPlaybackDatasource(&oMultiplier);
ITAPA.SetPlaybackDatasource( &oMultiplier );
ITAPA.Open();
ITAPA.Start();
......@@ -61,7 +64,7 @@ int main( int , char** )
cout << "Connected." << endl;
// Playback
float fSeconds = 100.0f;
float fSeconds = 10.0f;
cout << "Playback started, waiting " << fSeconds << " seconds" << endl;
ITAPA.Sleep( fSeconds ); // blocking
cout << "Done." << endl;
......@@ -75,7 +78,8 @@ int main( int , char** )
ITAPA.Close();
ITAPA.Finalize();
int iKey;
std::cin >> iKey;
return 0;
}
NetAudioLogNet = readtable( 'NetAudioLogNet.txt' );
NetAudioLogStream = readtable( 'NetAudioLogStream.txt' );
plot( NetAudioLogNet.WorldTimeStamp, [ NetAudioLogNet.NumSamplesTransmitted NetAudioLogNet.FreeSamples ] )
plot( NetAudioLogNet.WorldTimeStamp, [ NetAudioLogNet.NumSamplesTransmitted/1024 NetAudioLogNet.FreeSamples/1024 ] )
hold on
plot( NetAudioLogStream.WorldTimeStamp, NetAudioLogStream.FreeSamples )
\ No newline at end of file
plot( NetAudioLogStream.WorldTimeStamp, NetAudioLogStream.FreeSamples/1024 )
\ No newline at end of file
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