small changes

This commit is contained in:
Volker Fischer 2008-04-08 18:38:55 +00:00
parent 068b78fb24
commit ceacfd9a13
6 changed files with 40 additions and 37 deletions

View File

@ -132,7 +132,7 @@ void CClient::OnProtocolStatus ( bool bOk )
void CClient::Init()
{
// set block sizes (in samples)
iBlockSizeSam = MIN_BLOCK_SIZE_SAMPLES;
iBlockSizeSam = MIN_BLOCK_SIZE_SAMPLES;
iSndCrdBlockSizeSam = MIN_SND_CRD_BLOCK_SIZE_SAMPLES;
vecsAudioSndCrd.Init ( iSndCrdBlockSizeSam * 2 ); // stereo

View File

@ -70,8 +70,8 @@ public:
double MicLevelR() { return SignalLevelMeterR.MicLevel(); }
bool IsConnected() { return Channel.IsConnected(); }
/* we want to return the standard deviation. For that we need to calculate
the sqaure root */
/* We want to return the standard deviation. For that we need to calculate
the sqaure root. */
double GetTimingStdDev() { return sqrt ( RespTimeMoAvBuf.GetAverage() ); }
int GetAudioInFader() { return iAudioInFader; }

View File

@ -1,5 +1,5 @@
/******************************************************************************\
* Copyright (c) 2004-2006
* Copyright (c) 2004-2008
*
* Author(s):
* Volker Fischer
@ -11,13 +11,13 @@
* Foundation; either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
\******************************************************************************/
@ -49,19 +49,19 @@
// file name for logging file
#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
/* sample rate */
// sample rate
#define SAMPLE_RATE 24000
/* sound card sample rate. Should be always 48 kHz to avoid sound card driver
internal sample rate conversion which might be buggy */
// sound card sample rate. Should be always 48 kHz to avoid sound card driver
// internal sample rate conversion which might be buggy
#define SND_CRD_SAMPLE_RATE 48000
/* minimum block duration - all other buffer durations must be a multiple
of this duration */
#define MIN_BLOCK_DURATION_MS 2 /* ms */
// minimum block duration - all other buffer durations must be a multiple
// of this duration
#define MIN_BLOCK_DURATION_MS 2 // ms
#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 )

View File

@ -1,5 +1,5 @@
/******************************************************************************\
* Copyright (c) 2004-2007
* Copyright (c) 2004-2008
*
* Author(s):
* Volker Fischer
@ -11,13 +11,13 @@
* Foundation; either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
\******************************************************************************/

View File

@ -1,5 +1,5 @@
/******************************************************************************\
* Copyright (c) 2004-2006
* Copyright (c) 2004-2008
*
* Author(s):
* 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
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 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." );
}
@ -641,7 +644,7 @@ ASIOTime* CSound::bufferSwitchTimeInfo ( ASIOTime *timeInfo, long index, ASIOBoo
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
iBufferSizeIn = iNewBufferSize;
bBlockingRec = bNewBlocking;
bBlockingRec = bNewBlocking;
// reset interface so that all buffers are returned from the interface
waveInReset ( m_WaveIn );

View File

@ -35,8 +35,8 @@
/* Definitions ****************************************************************/
// switch here between ASIO (Steinberg) or native Windows(TM) sound interface
#undef USE_ASIO_SND_INTERFACE
//#define USE_ASIO_SND_INTERFACE
//#undef USE_ASIO_SND_INTERFACE
#define USE_ASIO_SND_INTERFACE
#define NUM_IN_OUT_CHANNELS 2 /* Stereo recording (but we only