ITANetAudioStreamingServerTest.cpp 921 Bytes
Newer Older
1 2 3
#include <iostream>
#include <string>

4 5
#include <ITANetAudioStreamingServer.h>
#include <ITANetAudioServer.h>
6
#include <ITAStreamFunctionGenerator.h>
7
#include <ITAStreamMultiplier1N.h>
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
8
#include <ITAFileDataSource.h>
9 10 11

using namespace std;

12
static string g_sServerName = "localhost";
13
static int g_iServerPort = 12480;
Anne's avatar
Anne committed
14
static double g_dSampleRate = 44100;
15 16
static int g_iBlockLength = 256;
static int g_iChannels = 1;
17

18
int main( int, char** )
19
{
20 21
	ITAFileDatasource oFile( "gershwin-mono.wav", g_iBlockLength );
	oFile.SetIsLooping( true );
22
	ITAStreamMultiplier1N oMuliplier( &oFile, g_iChannels );
23
	CITANetAudioStreamingServer oStreamingServer;
24
	oStreamingServer.SetInputStream( &oMuliplier );
25

26
	cout << "Starting net audio server and waiting for connections on '" << g_sServerName << "' on port " << g_iServerPort << endl;
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
27
	oStreamingServer.Start( g_sServerName, g_iServerPort );
Dipl.-Ing. Jonas Stienen's avatar
Stuff  
Dipl.-Ing. Jonas Stienen committed
28 29

	int iKey;
30
	std::cin >> iKey;
31

32 33
	return 0;
}