Skip to content
GitLab
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
d396a444
Commit
d396a444
authored
Jan 09, 2017
by
Anne
Browse files
bugfixes
parent
e52b29d6
Changes
5
Hide whitespace changes
Inline
Side-by-side
include/ITANetAudioStreamingClient.h
View file @
d396a444
...
...
@@ -24,6 +24,7 @@
#include
<ITANetAudioProtocol.h>
#include
<ITASampleFrame.h>
#include
<ITAStreamProbe.h>
#include
<VistaInterProcComm/Concurrency/VistaThreadEvent.h>
#include
<VistaInterProcComm/Concurrency/VistaThreadLoop.h>
...
...
@@ -61,6 +62,7 @@ protected:
private:
CITANetAudioClient
*
m_pClient
;
CITANetAudioStream
*
m_pStream
;
ITAStreamProbe
*
m_pStreamProbe
;
CITANetAudioProtocol
*
m_pProtocol
;
CITANetAudioMessage
*
m_pMessage
;
...
...
src/ITANetAudioStreamingClient.cpp
View file @
d396a444
...
...
@@ -12,6 +12,8 @@ CITANetAudioStreamingClient::CITANetAudioStreamingClient( CITANetAudioStream* pP
,
m_pConnection
(
NULL
)
,
m_bStopIndicated
(
false
)
{
m_pStreamProbe
=
new
ITAStreamProbe
(
pParent
,
"output.wav"
);
m_pClient
=
new
CITANetAudioClient
();
m_oParams
.
iChannels
=
pParent
->
GetNumberOfChannels
();
...
...
@@ -100,8 +102,12 @@ bool CITANetAudioStreamingClient::LoopBody()
// Receive samples from net message and forward them to the stream ring buffer
m_pMessage
->
ReadSampleFrame
(
&
m_sfReceivingBuffer
);
if
(
m_pStream
->
GetRingbufferFreeSamples
()
>=
m_sfReceivingBuffer
.
GetLength
())
m_pStream
->
Transmit
(
m_sfReceivingBuffer
,
m_sfReceivingBuffer
.
GetLength
());
if
(
m_pStream
->
GetRingbufferFreeSamples
(
)
>=
m_sfReceivingBuffer
.
GetLength
(
)
)
{
m_pStream
->
Transmit
(
m_sfReceivingBuffer
,
m_sfReceivingBuffer
.
GetLength
(
)
);
}
//else
// Fehler
...
...
src/ITANetAudioStreamingServer.cpp
View file @
d396a444
...
...
@@ -144,6 +144,8 @@ bool CITANetAudioStreamingServer::LoopBody()
m_pInputStream
->
IncrementBlockPointer
();
m_pMessage
->
SetAnswerType
(
CITANetAudioProtocol
::
NP_SERVER_SEND_SAMPLES
);
m_pMessage
->
WriteSampleFrame
(
&
m_sfTempTransmitBuffer
);
m_pMessage
->
WriteAnswer
();
m_pInputStream
->
IncrementBlockPointer
();
}
else
{
...
...
@@ -153,9 +155,7 @@ bool CITANetAudioStreamingServer::LoopBody()
break
;
}
m_pMessage
->
WriteAnswer
();
m_pInputStream
->
IncrementBlockPointer
();
float
fTimeOut
=
m_pInputStream
->
GetBlocklength
()
/
m_pInputStream
->
GetSampleRate
();
//VistaTimeUtils::Sleep( (int) ( 1 * 100 ) );
break
;
...
...
tests/NetAudio/ITANetAudioStreamingClientTest.cpp
View file @
d396a444
...
...
@@ -5,6 +5,8 @@
#include
<ITAPortaudioInterface.h>
#include
<ITAStreamMultiplier1N.h>
#include
<ITAException.h>
#include
<ITAFileDatasource.h>
#include
<ITAStreamProbe.h>
using
namespace
std
;
...
...
@@ -15,12 +17,13 @@ static int g_iBufferSize = 256;
int
main
(
int
,
char
**
)
{
CITANetAudioStream
oNetAudioStream
(
2
,
g_dSampleRate
,
g_iBufferSize
,
100
*
g_iBufferSize
);
//ITAStreamMultiplier1N oMultiplier( &oNetAudioStream, 2 );
CITANetAudioStream
oNetAudioStream
(
1
,
g_dSampleRate
,
g_iBufferSize
,
100
*
g_iBufferSize
);
ITAStreamProbe
oProbe
(
&
oNetAudioStream
,
"output.wav"
);
ITAStreamMultiplier1N
oMultiplier
(
&
oProbe
,
2
);
ITAPortaudioInterface
ITAPA
(
g_dSampleRate
,
g_iBufferSize
);
ITAPA
.
Initialize
();
ITAPA
.
SetPlaybackDatasource
(
&
o
NetAudioStream
);
ITAPA
.
SetPlaybackDatasource
(
&
o
Multiplier
);
ITAPA
.
Open
();
ITAPA
.
Start
();
...
...
@@ -55,6 +58,8 @@ int main( int , char** )
ITAPA
.
Stop
();
ITAPA
.
Close
();
ITAPA
.
Finalize
();
return
0
;
}
tests/NetAudio/ITANetAudioStreamingServerTest.cpp
View file @
d396a444
...
...
@@ -16,7 +16,7 @@ static int g_iBlockLength = 256;
int
main
(
int
,
char
**
)
{
ITAStreamFunctionGenerator
oGenerator
(
1
,
g_dSampleRate
,
g_iBlockLength
,
ITAStreamFunctionGenerator
::
SINE
,
456.78
f
,
0.81
f
,
true
);
ITAFileDatasource
oDatei
(
"Gershwin.wav"
,
g_iBlockLength
);
ITAFileDatasource
oDatei
(
"Gershwin
-mono
.wav"
,
g_iBlockLength
);
CITANetAudioStreamingServer
oStreamingServer
;
oStreamingServer
.
SetInputStream
(
&
oDatei
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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