small changes
This commit is contained in:
parent
068b78fb24
commit
ceacfd9a13
6 changed files with 40 additions and 37 deletions
|
@ -132,7 +132,7 @@ void CClient::OnProtocolStatus ( bool bOk )
|
||||||
void CClient::Init()
|
void CClient::Init()
|
||||||
{
|
{
|
||||||
// set block sizes (in samples)
|
// set block sizes (in samples)
|
||||||
iBlockSizeSam = MIN_BLOCK_SIZE_SAMPLES;
|
iBlockSizeSam = MIN_BLOCK_SIZE_SAMPLES;
|
||||||
iSndCrdBlockSizeSam = MIN_SND_CRD_BLOCK_SIZE_SAMPLES;
|
iSndCrdBlockSizeSam = MIN_SND_CRD_BLOCK_SIZE_SAMPLES;
|
||||||
|
|
||||||
vecsAudioSndCrd.Init ( iSndCrdBlockSizeSam * 2 ); // stereo
|
vecsAudioSndCrd.Init ( iSndCrdBlockSizeSam * 2 ); // stereo
|
||||||
|
|
|
@ -70,8 +70,8 @@ public:
|
||||||
double MicLevelR() { return SignalLevelMeterR.MicLevel(); }
|
double MicLevelR() { return SignalLevelMeterR.MicLevel(); }
|
||||||
bool IsConnected() { return Channel.IsConnected(); }
|
bool IsConnected() { return Channel.IsConnected(); }
|
||||||
|
|
||||||
/* we want to return the standard deviation. For that we need to calculate
|
/* We want to return the standard deviation. For that we need to calculate
|
||||||
the sqaure root */
|
the sqaure root. */
|
||||||
double GetTimingStdDev() { return sqrt ( RespTimeMoAvBuf.GetAverage() ); }
|
double GetTimingStdDev() { return sqrt ( RespTimeMoAvBuf.GetAverage() ); }
|
||||||
|
|
||||||
int GetAudioInFader() { return iAudioInFader; }
|
int GetAudioInFader() { return iAudioInFader; }
|
||||||
|
|
16
src/global.h
16
src/global.h
|
@ -1,5 +1,5 @@
|
||||||
/******************************************************************************\
|
/******************************************************************************\
|
||||||
* Copyright (c) 2004-2006
|
* Copyright (c) 2004-2008
|
||||||
*
|
*
|
||||||
* Author(s):
|
* Author(s):
|
||||||
* Volker Fischer
|
* Volker Fischer
|
||||||
|
@ -49,19 +49,19 @@
|
||||||
// file name for logging file
|
// file name for logging file
|
||||||
#define LOG_FILE_NAME "llconsrvlog.txt"
|
#define LOG_FILE_NAME "llconsrvlog.txt"
|
||||||
|
|
||||||
/* defined port number for client and server */
|
// defined port number for client and server
|
||||||
#define LLCON_PORT_NUMBER 22122
|
#define LLCON_PORT_NUMBER 22122
|
||||||
|
|
||||||
/* sample rate */
|
// sample rate
|
||||||
#define SAMPLE_RATE 24000
|
#define SAMPLE_RATE 24000
|
||||||
|
|
||||||
/* sound card sample rate. Should be always 48 kHz to avoid sound card driver
|
// sound card sample rate. Should be always 48 kHz to avoid sound card driver
|
||||||
internal sample rate conversion which might be buggy */
|
// internal sample rate conversion which might be buggy
|
||||||
#define SND_CRD_SAMPLE_RATE 48000
|
#define SND_CRD_SAMPLE_RATE 48000
|
||||||
|
|
||||||
/* minimum block duration - all other buffer durations must be a multiple
|
// minimum block duration - all other buffer durations must be a multiple
|
||||||
of this duration */
|
// of this duration
|
||||||
#define MIN_BLOCK_DURATION_MS 2 /* ms */
|
#define MIN_BLOCK_DURATION_MS 2 // ms
|
||||||
|
|
||||||
#define MIN_BLOCK_SIZE_SAMPLES ( MIN_BLOCK_DURATION_MS * SAMPLE_RATE / 1000 )
|
#define MIN_BLOCK_SIZE_SAMPLES ( MIN_BLOCK_DURATION_MS * SAMPLE_RATE / 1000 )
|
||||||
#define MIN_SND_CRD_BLOCK_SIZE_SAMPLES ( MIN_BLOCK_DURATION_MS * SND_CRD_SAMPLE_RATE / 1000 )
|
#define MIN_SND_CRD_BLOCK_SIZE_SAMPLES ( MIN_BLOCK_DURATION_MS * SND_CRD_SAMPLE_RATE / 1000 )
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/******************************************************************************\
|
/******************************************************************************\
|
||||||
* Copyright (c) 2004-2007
|
* Copyright (c) 2004-2008
|
||||||
*
|
*
|
||||||
* Author(s):
|
* Author(s):
|
||||||
* Volker Fischer
|
* Volker Fischer
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/******************************************************************************\
|
/******************************************************************************\
|
||||||
* Copyright (c) 2004-2006
|
* Copyright (c) 2004-2008
|
||||||
*
|
*
|
||||||
* Author(s):
|
* Author(s):
|
||||||
* Volker Fischer
|
* Volker Fischer
|
||||||
|
@ -332,6 +332,22 @@ void CSound::InitRecordingAndPlayback ( int iNewBufferSize )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// TODO this should be done in the setinoutbuf functions
|
||||||
|
// create and activate buffers
|
||||||
|
ASIOCreateBuffers(bufferInfos, 2 * NUM_IN_OUT_CHANNELS,
|
||||||
|
iBufferSize * BYTES_PER_SAMPLE, &asioCallbacks);
|
||||||
|
|
||||||
|
// now set all the buffer details
|
||||||
|
for ( i = 0; i < 2 * NUM_IN_OUT_CHANNELS; i++ )
|
||||||
|
{
|
||||||
|
channelInfos[i].channel = NUM_IN_OUT_CHANNELS;
|
||||||
|
channelInfos[i].isInput = bufferInfos[i].isInput;
|
||||||
|
ASIOGetChannelInfo ( &channelInfos[i] );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// reset interface so that all buffers are returned from the interface
|
// reset interface so that all buffers are returned from the interface
|
||||||
waveInReset ( m_WaveIn );
|
waveInReset ( m_WaveIn );
|
||||||
|
@ -380,20 +396,7 @@ void CSound::InitRecordingAndPlayback ( int iNewBufferSize )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// TODO this should be done in the setinoutbuf functions
|
|
||||||
// create and activate buffers
|
|
||||||
// ASIOCreateBuffers(bufferInfos, 2 * NUM_IN_OUT_CHANNELS,
|
|
||||||
// iBufferSizeIn * BYTES_PER_SAMPLE, &asioCallbacks);
|
|
||||||
ASIOCreateBuffers(bufferInfos, 2 * NUM_IN_OUT_CHANNELS,
|
|
||||||
iBufferSize * BYTES_PER_SAMPLE, &asioCallbacks);
|
|
||||||
|
|
||||||
// now set all the buffer details
|
|
||||||
for ( i = 0; i < 2 * NUM_IN_OUT_CHANNELS; i++ )
|
|
||||||
{
|
|
||||||
channelInfos[i].channel = NUM_IN_OUT_CHANNELS;
|
|
||||||
channelInfos[i].isInput = bufferInfos[i].isInput;
|
|
||||||
ASIOGetChannelInfo ( &channelInfos[i] );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -519,7 +522,7 @@ pstrDevices[0] = driverInfo.name;
|
||||||
long lNumInChan;
|
long lNumInChan;
|
||||||
long lNumOutChan;
|
long lNumOutChan;
|
||||||
ASIOGetChannels ( &lNumInChan, &lNumOutChan );
|
ASIOGetChannels ( &lNumInChan, &lNumOutChan );
|
||||||
if ( ( lNumInChan != NUM_IN_OUT_CHANNELS ) || ( lNumOutChan != NUM_IN_OUT_CHANNELS ) )
|
if ( ( lNumInChan < NUM_IN_OUT_CHANNELS ) || ( lNumOutChan < NUM_IN_OUT_CHANNELS ) )
|
||||||
{
|
{
|
||||||
throw CGenErr ( "The audio device does not support required number of channels." );
|
throw CGenErr ( "The audio device does not support required number of channels." );
|
||||||
}
|
}
|
||||||
|
@ -641,7 +644,7 @@ ASIOTime* CSound::bufferSwitchTimeInfo ( ASIOTime *timeInfo, long index, ASIOBoo
|
||||||
return 0L;
|
return 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSound::bufferSwitch( long index, ASIOBool processNow )
|
void CSound::bufferSwitch ( long index, ASIOBool processNow )
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
@ -861,7 +864,7 @@ void CSound::InitRecording ( int iNewBufferSize, bool bNewBlocking )
|
||||||
|
|
||||||
// set internal parameter
|
// set internal parameter
|
||||||
iBufferSizeIn = iNewBufferSize;
|
iBufferSizeIn = iNewBufferSize;
|
||||||
bBlockingRec = bNewBlocking;
|
bBlockingRec = bNewBlocking;
|
||||||
|
|
||||||
// reset interface so that all buffers are returned from the interface
|
// reset interface so that all buffers are returned from the interface
|
||||||
waveInReset ( m_WaveIn );
|
waveInReset ( m_WaveIn );
|
||||||
|
|
|
@ -35,8 +35,8 @@
|
||||||
|
|
||||||
/* Definitions ****************************************************************/
|
/* Definitions ****************************************************************/
|
||||||
// switch here between ASIO (Steinberg) or native Windows(TM) sound interface
|
// switch here between ASIO (Steinberg) or native Windows(TM) sound interface
|
||||||
#undef USE_ASIO_SND_INTERFACE
|
//#undef USE_ASIO_SND_INTERFACE
|
||||||
//#define USE_ASIO_SND_INTERFACE
|
#define USE_ASIO_SND_INTERFACE
|
||||||
|
|
||||||
|
|
||||||
#define NUM_IN_OUT_CHANNELS 2 /* Stereo recording (but we only
|
#define NUM_IN_OUT_CHANNELS 2 /* Stereo recording (but we only
|
||||||
|
|
Loading…
Reference in a new issue