Aufgrund einer Wartung wird GitLab am 21.09. zwischen 8:00 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 21.09. between 8:00 and 9:00 am.

Commit 1d1fe808 authored by Anne's avatar Anne
Browse files

tests datendurchstatz Client

parent 2051bbd0
...@@ -92,7 +92,7 @@ CITANetAudioStream::CITANetAudioStream( int iChannels, double dSamplingRate, int ...@@ -92,7 +92,7 @@ CITANetAudioStream::CITANetAudioStream( int iChannels, double dSamplingRate, int
, m_bRingBufferFull( false ) , m_bRingBufferFull( false )
, m_iStreamingStatus( INVALID ) , m_iStreamingStatus( INVALID )
, m_dLastStreamingTimeCode( 0.0f ) , m_dLastStreamingTimeCode( 0.0f )
, m_iTargetSampleLatency( 5*iBufferSize ) , m_iTargetSampleLatency( 10*iBufferSize )
{ {
m_bRingBufferFull = false; m_bRingBufferFull = false;
if( iBufferSize > iRingBufferCapacity ) if( iBufferSize > iRingBufferCapacity )
...@@ -116,9 +116,9 @@ CITANetAudioStream::CITANetAudioStream( int iChannels, double dSamplingRate, int ...@@ -116,9 +116,9 @@ CITANetAudioStream::CITANetAudioStream( int iChannels, double dSamplingRate, int
CITANetAudioStream::~CITANetAudioStream() CITANetAudioStream::~CITANetAudioStream()
{ {
delete m_pNetAudioStreamingClient;
delete m_pStreamLogger;
delete m_pNetLogger; delete m_pNetLogger;
delete m_pStreamLogger;
delete m_pNetAudioStreamingClient;
} }
bool CITANetAudioStream::Connect( const std::string& sAddress, int iPort ) bool CITANetAudioStream::Connect( const std::string& sAddress, int iPort )
......
...@@ -12,45 +12,35 @@ ...@@ -12,45 +12,35 @@
using namespace std; using namespace std;
//static string g_sServerName = "137.226.61.163"; //static string g_sServerName = "137.226.61.163";
static string g_sServerName = "localhost"; static string g_sServerName = "137.226.61.67";
static int g_iServerPort = 12480; static int g_iServerPort = 12480;
static double g_dSampleRate = 44100; static double g_dSampleRate = 44100;
static int g_iBufferSize = 1024; static int g_iBufferSize = 512;
static int g_iChannels = 20; static int g_iChannels = 500;
int main( int , char** ) int main( int , char** )
{ {
CITANetAudioStream oNetAudioStream( g_iChannels, g_dSampleRate, g_iBufferSize, 100 * g_iBufferSize ); CITANetAudioStream oNetAudioStream( g_iChannels, g_dSampleRate, g_iBufferSize, 100 * g_iBufferSize );
ITAStreamPatchbay oPatchbay( g_dSampleRate, g_iBufferSize ); ITAStreamPatchbay oPatchbay( g_dSampleRate, g_iBufferSize );
oPatchbay.AddInput( &oNetAudioStream ); oPatchbay.AddInput( &oNetAudioStream );
ITADatasource* pOutput; int iOutputID = oPatchbay.AddOutput( 2 );
int N = int( oNetAudioStream.GetNumberOfChannels( ) );
for ( int i = 0; i < N; i++ )
oPatchbay.ConnectChannels( 0, i, 0, i % 2, 1 / double( N ) );
ITAStreamProbe oProbe( oPatchbay.GetOutputDatasource( iOutputID ), "ITANetAudioTest.stream.wav" );
oPatchbay.AddOutput( 1 );
/*
for ( int i = 0; i < oNetAudioStream.GetNumberOfChannels( ); i++ )
{
if ( i % 2 == 0 )
oPatchbay.ConnectChannels( 0, i, 0, 0 );
else
oPatchbay.ConnectChannels( 0, i, 0, 1 );
*/
oPatchbay.ConnectChannels( 0, 0, 0, 0, 1.0f );
pOutput = oPatchbay.GetOutputDatasource( 0 );
oPatchbay.SetOutputMuted( 0, true );
ITAStreamProbe oProbe( pOutput, "output.wav" );
ITAStreamMultiplier1N oMultiplier( &oProbe, 2 );
ITAPortaudioInterface ITAPA( g_dSampleRate, g_iBufferSize ); ITAPortaudioInterface ITAPA( g_dSampleRate, g_iBufferSize );
ITAPA.Initialize(); ITAPA.Initialize();
ITAPA.SetPlaybackDatasource( &oMultiplier ); ITAPA.SetPlaybackDatasource( &oProbe );
ITAPA.Open(); ITAPA.Open();
ITAPA.Start(); ITAPA.Start();
cout << "Waiting 3 seconds (net audio stream not connected and returning zeros)" << endl; cout << "Waiting 3 seconds (net audio stream not connected and returning zeros)" << endl;
ITAPA.Sleep( 3.0f ); ITAPA.Sleep( 2.0f );
cout << "Will now connect to '" << g_sServerName << "' on port " << g_iServerPort << endl; cout << "Will now connect to '" << g_sServerName << "' on port " << g_iServerPort << endl;
try try
...@@ -75,7 +65,7 @@ int main( int , char** ) ...@@ -75,7 +65,7 @@ int main( int , char** )
cout << "Will now disconnect from '" << g_sServerName << "' and port " << g_iServerPort << endl; cout << "Will now disconnect from '" << g_sServerName << "' and port " << g_iServerPort << endl;
cout << "Closing in 3 seconds (net audio stream not connected and returning zeros)" << endl; cout << "Closing in 3 seconds (net audio stream not connected and returning zeros)" << endl;
ITAPA.Sleep( 3.0f ); ITAPA.Sleep( 1.0f );
ITAPA.Stop(); ITAPA.Stop();
ITAPA.Close(); ITAPA.Close();
......
NetAudioLogNet = readtable( 'NetAudioLogNet.txt' ); NetAudioLogNet = readtable( 'NetAudioLogNet.txt' );
NetAudioLogStream = readtable( 'NetAudioLogStream.txt' ); NetAudioLogStream = readtable( 'NetAudioLogStream.txt' );
plot( NetAudioLogNet.WorldTimeStamp, NetAudioLogNet.FreeSamples/NetAudioLogNet.NumSamplesTransmitted ) plot( NetAudioLogNet.WorldTimeStamp, NetAudioLogNet.FreeSamples/10240 )
hold on hold on
plot( NetAudioLogStream.WorldTimeStamp, NetAudioLogStream.FreeSamples/NetAudioLogNet.NumSamplesTransmitted ) plot( NetAudioLogStream.WorldTimeStamp, NetAudioLogStream.FreeSamples/10240 )
\ No newline at end of file hold on
%plot( NetAudioLogNet.WorldTimeStamp, NetAudioLogNet.Bufferstatus )
plot( NetAudioLogStream.WorldTimeStamp, NetAudioLogStream.StreamingStatus )
\ 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