Browse Source

Switched to 8000Hz for recording, because 44.1KHz is way overkill

Bill Meltsner 15 years ago
parent
commit
3f4cd68287
1 changed files with 2 additions and 3 deletions
  1. 2 3
      src/modules/audio/openal/Audio.cpp

+ 2 - 3
src/modules/audio/openal/Audio.cpp

@@ -57,8 +57,7 @@ namespace openal
 			}
 		}
 		
-		capture = alcCaptureOpenDevice(captureName.c_str(), love::sound::Decoder::DEFAULT_SAMPLE_RATE,
-									   AL_FORMAT_MONO16, 1048576); // about 23 seconds
+		capture = alcCaptureOpenDevice(captureName.c_str(), 8000, AL_FORMAT_MONO16, 262144); // about 32 seconds
 		
 		if (!capture) {
 			// We're not going to prevent LOVE from running without a microphone, but we should warn, at least
@@ -219,7 +218,7 @@ namespace openal
 	love::sound::SoundData * Audio::getRecordedData()
 	{
 		if (!canRecord()) return NULL;
-		int samplerate = love::sound::Decoder::DEFAULT_SAMPLE_RATE;
+		int samplerate = 8000;
 		ALCint samples;
 		alcGetIntegerv(capture, ALC_CAPTURE_SAMPLES, 4, &samples);
 		void * data = malloc(samples * (2/sizeof(char)));