Commit 01425b60 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Updating net audio test (portaudio single instance over localhost)

parent f841f8d3
...@@ -21,20 +21,24 @@ const static string g_sServerName = "localhost"; ...@@ -21,20 +21,24 @@ const static string g_sServerName = "localhost";
const static string g_sInputFilePath = "gershwin-mono.wav"; const static string g_sInputFilePath = "gershwin-mono.wav";
const static int g_iServerPort = 12480; const static int g_iServerPort = 12480;
const static double g_dSampleRate = 44100; const static double g_dSampleRate = 44100;
const static int g_iBlockLength = 32; const static int g_iBlockLength = 512;
const static int g_iChannels = 2; const static int g_iChannels = 2;
const static int g_iTargetLatencySamples = 512;
class CServer : public VistaThread class CServer : public VistaThread
{ {
public: public:
inline CServer( const string& sInputFilePath ) inline CServer( const string& sInputFilePath )
{ {
pStreamingServer = new CITANetAudioStreamingServer;
pStreamingServer->SetTargetLatencySamples( g_iTargetLatencySamples );
pStreamingServer->SetServerLogBaseName( "ITANetAudioTest_Server" );
pInputFile = new ITAFileDatasource( sInputFilePath, g_iBlockLength ); pInputFile = new ITAFileDatasource( sInputFilePath, g_iBlockLength );
assert( pInputFile->GetNumberOfChannels() == 1 ); assert( pInputFile->GetNumberOfChannels() == 1 );
pMuliplier = new ITAStreamMultiplier1N( pInputFile, g_iChannels ); pMuliplier = new ITAStreamMultiplier1N( pInputFile, g_iChannels );
pStreamingServer = new CITANetAudioStreamingServer; pInputStreamProbe = new ITAStreamProbe( pMuliplier, "ITANetAudioTest.serverstream.wav" );
pStreamingServer->SetInputStream( pInputStreamProbe );
pStreamingServer->SetInputStream( pMuliplier );
Run(); Run();
}; };
...@@ -44,6 +48,7 @@ public: ...@@ -44,6 +48,7 @@ public:
delete pInputFile; delete pInputFile;
delete pMuliplier; delete pMuliplier;
delete pStreamingServer; delete pStreamingServer;
delete pInputStreamProbe;
}; };
void ThreadBody( ) void ThreadBody( )
...@@ -56,6 +61,8 @@ private: ...@@ -56,6 +61,8 @@ private:
ITAFileDatasource* pInputFile; ITAFileDatasource* pInputFile;
ITAStreamMultiplier1N* pMuliplier; ITAStreamMultiplier1N* pMuliplier;
CITANetAudioStreamingServer* pStreamingServer; CITANetAudioStreamingServer* pStreamingServer;
ITAStreamProbe* pInputStreamProbe;
}; };
int main( int, char** ) int main( int, char** )
...@@ -65,6 +72,7 @@ int main( int, char** ) ...@@ -65,6 +72,7 @@ int main( int, char** )
// Client dumping received stream and mixing down to two channels // Client dumping received stream and mixing down to two channels
CITANetAudioStream oNetAudioStream( g_iChannels, g_dSampleRate, g_iBlockLength, 20 * g_iBlockLength ); CITANetAudioStream oNetAudioStream( g_iChannels, g_dSampleRate, g_iBlockLength, 20 * g_iBlockLength );
oNetAudioStream.SetNetAudioStreamingLoggerBaseName( "ITANetAudioTest_NetAudioStream" );
ITAStreamPatchbay oPatchbay( g_dSampleRate, g_iBlockLength ); ITAStreamPatchbay oPatchbay( g_dSampleRate, g_iBlockLength );
oPatchbay.AddInput( &oNetAudioStream ); oPatchbay.AddInput( &oNetAudioStream );
...@@ -74,7 +82,7 @@ int main( int, char** ) ...@@ -74,7 +82,7 @@ int main( int, char** )
for ( int i = 0; i < N ; i++ ) for ( int i = 0; i < N ; i++ )
oPatchbay.ConnectChannels( 0, i, 0, i % 2, 1 / double( N ) ); oPatchbay.ConnectChannels( 0, i, 0, i % 2, 1 / double( N ) );
ITAStreamProbe oProbe( oPatchbay.GetOutputDatasource( iOutputID ), "ITANetAudioTest.stream.wav" ); ITAStreamProbe oProbe( oPatchbay.GetOutputDatasource( iOutputID ), "ITANetAudioTest.netstream.wav" );
ITAPortaudioInterface ITAPA( g_dSampleRate, g_iBlockLength ); ITAPortaudioInterface ITAPA( g_dSampleRate, g_iBlockLength );
ITAPA.Initialize(); ITAPA.Initialize();
......
Supports Markdown
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