ITANetAudioSampleServerTest.cpp 803 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
#include <iostream>
#include <string>

#include <ITANetAudioSampleServer.h>
#include <ITAStreamFunctionGenerator.h>

using namespace std;

static string g_sServerName = "localhost";
static int g_iServerPort = 12480;
static double g_dSampleRate = 44.1e3;
12
static int g_iBlockLength = 265;
13
14
15

int main( int , char** )
{
16
17
18
	ITAStreamFunctionGenerator oGenerator( 1, g_dSampleRate, g_iBlockLength );
	oGenerator.SetFunction( ITAStreamFunctionGenerator::SINE );
	oGenerator.SetFrequency( 567.89f );
19

20
21
22
23
24
	CITANetAudioSampleServer oSampleServer;
	oSampleServer.SetInputStream( &oGenerator );

	cout << "Starting server and waiting for connections on '" << oSampleServer.GetNetworkAddress() << "' on port " << oSampleServer.GetNetworkPort() << endl;
	oSampleServer.Start( g_sServerName, g_iServerPort );
25
26
27
	
	return 0;
}