setting the sound card recording sample rate is now more relaxed

there is no error reported if the sample rate is not exactly the same
This commit is contained in:
darkeye 2001-09-02 14:08:40 +00:00
parent a251f4ad26
commit 05335d1d59
2 changed files with 19 additions and 4 deletions

View File

@ -172,11 +172,17 @@ OssDspSource :: open ( void ) throw ( Exception )
} }
u = getSampleRate(); u = getSampleRate();
if ( ioctl( fileDescriptor, SNDCTL_DSP_SPEED, &u) == -1 || if ( ioctl( fileDescriptor, SNDCTL_DSP_SPEED, &u) == -1 ) {
u != getSampleRate() ) {
close(); close();
throw Exception( __FILE__, __LINE__, "can't set speed", u); throw Exception( __FILE__, __LINE__,
"can't set soundcard recording sample rate", u);
}
if ( u != getSampleRate() ) {
reportEvent( 2, "sound card recording sample rate set to ", u,
" while trying to set it to ", getSampleRate());
reportEvent( 2, "this is probably not a problem, but a slight "
"drift in the sound card driver");
} }
return true; return true;
@ -265,6 +271,10 @@ OssDspSource :: close ( void ) throw ( Exception )
$Source$ $Source$
$Log$ $Log$
Revision 1.8 2001/09/02 14:08:40 darkeye
setting the sound card recording sample rate is now more relaxed
there is no error reported if the sample rate is not exactly the same
Revision 1.7 2001/08/30 17:25:56 darkeye Revision 1.7 2001/08/30 17:25:56 darkeye
renamed configure.h to config.h renamed configure.h to config.h

View File

@ -36,6 +36,7 @@
/* ============================================================ include files */ /* ============================================================ include files */
#include "Reporter.h"
#include "AudioSource.h" #include "AudioSource.h"
@ -53,7 +54,7 @@
* @author $Author$ * @author $Author$
* @version $Revision$ * @version $Revision$
*/ */
class OssDspSource : public AudioSource class OssDspSource : public AudioSource, public virtual Reporter
{ {
private: private:
@ -250,6 +251,10 @@ class OssDspSource : public AudioSource
$Source$ $Source$
$Log$ $Log$
Revision 1.4 2001/09/02 14:08:40 darkeye
setting the sound card recording sample rate is now more relaxed
there is no error reported if the sample rate is not exactly the same
Revision 1.3 2000/11/12 13:31:40 darkeye Revision 1.3 2000/11/12 13:31:40 darkeye
added kdoc-style documentation comments added kdoc-style documentation comments