Diffstat (limited to 'noncore/multimedia/opierec/wavFile.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opierec/wavFile.cpp | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/noncore/multimedia/opierec/wavFile.cpp b/noncore/multimedia/opierec/wavFile.cpp index fc0130c..360b884 100644 --- a/noncore/multimedia/opierec/wavFile.cpp +++ b/noncore/multimedia/opierec/wavFile.cpp @@ -153,7 +153,5 @@ bool WavFile::setWavHeader(int fd, wavhdr *hdr) { write( fd,hdr, sizeof(*hdr)); - odebug << "writing header: bitrate " << wavResolution - << ", samplerate " << wavSampleRate - << ", channels " << wavChannels << oendl; + odebug << "writing header: bitrate " << wavResolution << ", samplerate " << wavSampleRate << ", channels " << wavChannels << oendl; return true; } @@ -178,18 +176,18 @@ int WavFile::parseWavHeader(int fd) { if (read(fd, string, 4) < 4) { - odebug << " Could not read from sound file.\n" << oendl; + odebug << " Could not read from sound file." << oendl; return -1; } if (strncmp(string, "RIFF", 4)) { - odebug << " not a valid WAV file.\n" << oendl; + odebug << " not a valid WAV file." << oendl; return -1; } lseek(fd, 4, SEEK_CUR); if (read(fd, string, 4) < 4) { - odebug << "Could not read from sound file.\n" << oendl; + odebug << "Could not read from sound file." << oendl; return -1; } if (strncmp(string, "WAVE", 4)) { - odebug << "not a valid WAV file.\n" << oendl; + odebug << "not a valid WAV file." << oendl; return -1; } @@ -198,10 +196,10 @@ int WavFile::parseWavHeader(int fd) { while (!found) { if (read(fd, string, 4) < 4) { - odebug << "Could not read from sound file.\n" << oendl; + odebug << "Could not read from sound file." << oendl; return -1; } if (strncmp(string, "fmt ", 4)) { if (read(fd, &longdata, 4) < 4) { - odebug << "Could not read from sound file.\n" << oendl; + odebug << "Could not read from sound file." << oendl; return -1; } @@ -210,9 +208,9 @@ int WavFile::parseWavHeader(int fd) { lseek(fd, 4, SEEK_CUR); if (read(fd, &fmt, 2) < 2) { - odebug << "Could not read format chunk.\n" << oendl; + odebug << "Could not read format chunk." << oendl; return -1; } if (fmt != WAVE_FORMAT_PCM && fmt != WAVE_FORMAT_DVI_ADPCM) { - odebug << "Wave file contains unknown format. Unable to continue.\n" << oendl; + odebug << "Wave file contains unknown format. Unable to continue." << oendl; return -1; } @@ -221,5 +219,5 @@ int WavFile::parseWavHeader(int fd) { odebug << "compressionFormat is " << fmt << "" << oendl; if (read(fd, &ch, 2) < 2) { - odebug << "Could not read format chunk.\n" << oendl; + odebug << "Could not read format chunk." << oendl; return -1; } else { @@ -228,5 +226,5 @@ int WavFile::parseWavHeader(int fd) { } if (read(fd, &samplerrate, 4) < 4) { - odebug << "Could not read from format chunk.\n" << oendl; + odebug << "Could not read from format chunk." << oendl; return -1; } else { @@ -237,5 +235,5 @@ int WavFile::parseWavHeader(int fd) { lseek(fd, 6, SEEK_CUR); if (read(fd, &bitrate, 2) < 2) { - odebug << "Could not read format chunk.\n" << oendl; + odebug << "Could not read format chunk." << oendl; return -1; } else { @@ -250,5 +248,5 @@ int WavFile::parseWavHeader(int fd) { while (!found) { if (read(fd, string, 4) < 4) { - odebug << "Could not read from sound file.\n" << oendl; + odebug << "Could not read from sound file." << oendl; return -1; } @@ -256,5 +254,5 @@ int WavFile::parseWavHeader(int fd) { if (strncmp(string, "data", 4)) { if (read(fd, &longdata, 4)<4) { - odebug << "Could not read from sound file.\n" << oendl; + odebug << "Could not read from sound file." << oendl; return -1; } @@ -263,9 +261,9 @@ int WavFile::parseWavHeader(int fd) { } else { if (read(fd, &longdata, 4) < 4) { - odebug << "Could not read from sound file.\n" << oendl; + odebug << "Could not read from sound file." << oendl; return -1; } else { wavNumberSamples = longdata; - odebug << "file hase length of " << (int)longdata << "\n" + odebug << "file hase length of " << (int)longdata << "" << "lasting " << (int)(( longdata / wavSampleRate) / wavChannels) / ( wavChannels*( wavResolution/8)) |