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
, m_bRingBufferFull( false )
, m_iStreamingStatus( INVALID )
, m_dLastStreamingTimeCode( 0.0f )
, m_iTargetSampleLatency( 5*iBufferSize )
, m_iTargetSampleLatency( 10*iBufferSize )
{
m_bRingBufferFull = false;
if( iBufferSize > iRingBufferCapacity )
......@@ -116,9 +116,9 @@ CITANetAudioStream::CITANetAudioStream( int iChannels, double dSamplingRate, int
CITANetAudioStream::~CITANetAudioStream()
{
delete m_pNetAudioStreamingClient;
delete m_pStreamLogger;
delete m_pNetLogger;
delete m_pStreamLogger;
delete m_pNetAudioStreamingClient;
}
bool CITANetAudioStream::Connect( const std::string& sAddress, int iPort )
......
......@@ -12,45 +12,35 @@
using namespace std;
//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 double g_dSampleRate = 44100;
static int g_iBufferSize = 1024;
static int g_iChannels = 20;
static int g_iBufferSize = 512;
static int g_iChannels = 500;
int main( int , char** )
{
CITANetAudioStream oNetAudioStream( g_iChannels, g_dSampleRate, g_iBufferSize, 100 * g_iBufferSize );
ITAStreamPatchbay oPatchbay( g_dSampleRate, g_iBufferSize );
oPatchbay.AddInput( &oNetAudioStream );
ITADatasource* pOutput;
ITAStreamPatchbay oPatchbay( g_dSampleRate, g_iBufferSize );
oPatchbay.AddInput( &oNetAudioStream );
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 );
ITAPA.Initialize();
ITAPA.SetPlaybackDatasource( &oMultiplier );
ITAPA.SetPlaybackDatasource( &oProbe );
ITAPA.Open();
ITAPA.Start();
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;
try
......@@ -75,7 +65,7 @@ int main( int , char** )
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;
ITAPA.Sleep( 3.0f );
ITAPA.Sleep( 1.0f );
ITAPA.Stop();
ITAPA.Close();
......
NetAudioLogNet = readtable( 'NetAudioLogNet.txt' );
NetAudioLogStream = readtable( 'NetAudioLogStream.txt' );
plot( NetAudioLogNet.WorldTimeStamp, NetAudioLogNet.FreeSamples/NetAudioLogNet.NumSamplesTransmitted )
plot( NetAudioLogNet.WorldTimeStamp, NetAudioLogNet.FreeSamples/10240 )
hold on
plot( NetAudioLogStream.WorldTimeStamp, NetAudioLogStream.FreeSamples/NetAudioLogNet.NumSamplesTransmitted )
\ No newline at end of file
plot( NetAudioLogStream.WorldTimeStamp, NetAudioLogStream.FreeSamples/10240 )
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