Skip to content
Snippets Groups Projects
Commit f1d3ffe8 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

Save Wave fixed

parent 1668ba97
No related branches found
No related tags found
No related merge requests found
......@@ -56,12 +56,14 @@ void AudioRecord::setSndSamplingRate(int smplRate){
void AudioRecord::setRecordingOption(FILE_TYPE type, SOUND_FORMAT format, int sndSmplRate, std::string path){
std::string fName;
fileType_ = type;
std::string fName;
fileType_ = type;
sndFormat_ = format;
channels_ = 1;
sndSmplRate_ = sndSmplRate;
if (fileType_ == FILE_RAW){
if ( strstr(fileName_, ".raw") == NULL){
......@@ -79,7 +81,6 @@ void AudioRecord::setRecordingOption(FILE_TYPE type, SOUND_FORMAT format, int sn
fName = fileName_;
savePath_ = path + "/";
savePath_.append(fName);
}
void AudioRecord::openFile(){
......@@ -122,6 +123,8 @@ void AudioRecord::closeFile() {
else if (fileType_ == FILE_WAV)
this->closeWavFile();
}
......@@ -331,7 +334,7 @@ void AudioRecord::closeWavFile()
_debug("AudioRecord:: Can't closeWavFile, a file has not yet been opened!\n");
return;
}
/*
_debug("AudioRecord::closeWavFile() \n");
if ( fclose( fp ) != 0)
......@@ -344,7 +347,7 @@ void AudioRecord::closeWavFile()
_debug("AudioRecord::closeWavFile() : could not open WAV file rb+!\n");
return;
}
*/
SINT32 bytes = byteCounter_ * channels_;
fseek(fp, 40, SEEK_SET); // jump to data length
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment