Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
ITADataSources
Commits
01425b60
Commit
01425b60
authored
Mar 27, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Updating net audio test (portaudio single instance over localhost)
parent
f841f8d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/NetAudio/ITANetAudioTest.cpp
View file @
01425b60
...
...
@@ -21,20 +21,24 @@ const static string g_sServerName = "localhost";
const
static
string
g_sInputFilePath
=
"gershwin-mono.wav"
;
const
static
int
g_iServerPort
=
12480
;
const
static
double
g_dSampleRate
=
44100
;
const
static
int
g_iBlockLength
=
3
2
;
const
static
int
g_iBlockLength
=
51
2
;
const
static
int
g_iChannels
=
2
;
const
static
int
g_iTargetLatencySamples
=
512
;
class
CServer
:
public
VistaThread
{
public:
inline
CServer
(
const
string
&
sInputFilePath
)
{
pStreamingServer
=
new
CITANetAudioStreamingServer
;
pStreamingServer
->
SetTargetLatencySamples
(
g_iTargetLatencySamples
);
pStreamingServer
->
SetServerLogBaseName
(
"ITANetAudioTest_Server"
);
pInputFile
=
new
ITAFileDatasource
(
sInputFilePath
,
g_iBlockLength
);
assert
(
pInputFile
->
GetNumberOfChannels
()
==
1
);
pMuliplier
=
new
ITAStreamMultiplier1N
(
pInputFile
,
g_iChannels
);
pStreamingServer
=
new
CITANetAudioStreamingServer
;
pStreamingServer
->
SetInputStream
(
pMuliplier
);
pInputStreamProbe
=
new
ITAStreamProbe
(
pMuliplier
,
"ITANetAudioTest.serverstream.wav"
);
pStreamingServer
->
SetInputStream
(
pInputStreamProbe
);
Run
();
};
...
...
@@ -44,6 +48,7 @@ public:
delete
pInputFile
;
delete
pMuliplier
;
delete
pStreamingServer
;
delete
pInputStreamProbe
;
};
void
ThreadBody
(
)
...
...
@@ -56,6 +61,8 @@ private:
ITAFileDatasource
*
pInputFile
;
ITAStreamMultiplier1N
*
pMuliplier
;
CITANetAudioStreamingServer
*
pStreamingServer
;
ITAStreamProbe
*
pInputStreamProbe
;
};
int
main
(
int
,
char
**
)
...
...
@@ -65,6 +72,7 @@ int main( int, char** )
// Client dumping received stream and mixing down to two channels
CITANetAudioStream
oNetAudioStream
(
g_iChannels
,
g_dSampleRate
,
g_iBlockLength
,
20
*
g_iBlockLength
);
oNetAudioStream
.
SetNetAudioStreamingLoggerBaseName
(
"ITANetAudioTest_NetAudioStream"
);
ITAStreamPatchbay
oPatchbay
(
g_dSampleRate
,
g_iBlockLength
);
oPatchbay
.
AddInput
(
&
oNetAudioStream
);
...
...
@@ -74,7 +82,7 @@ int main( int, char** )
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"
);
ITAStreamProbe
oProbe
(
oPatchbay
.
GetOutputDatasource
(
iOutputID
),
"ITANetAudioTest.
net
stream.wav"
);
ITAPortaudioInterface
ITAPA
(
g_dSampleRate
,
g_iBlockLength
);
ITAPA
.
Initialize
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment