6f0edf21abe7 — Chris Cannam tip 2 months ago
Don't print errors as well as returning them
3 files changed, 6 insertions(+), 10 deletions(-)

M src/CoreAudioWriteStream.cpp
M src/SimpleWavFileWriteStream.cpp
M src/WavFileWriteStream.cpp
M src/CoreAudioWriteStream.cpp +6 -6
@@ 102,7 102,7 @@ CoreAudioWriteStream::CoreAudioWriteStre
     AudioWriteStream(target),
     m_d(new D)
 {
-    cerr << "CoreAudioWriteStream: file is " << getPath() << ", channel count is " << getChannelCount() << ", sample rate " << getSampleRate() << endl;
+//    cerr << "CoreAudioWriteStream: file is " << getPath() << ", channel count is " << getChannelCount() << ", sample rate " << getSampleRate() << endl;
 
     UInt32 propsize = sizeof(AudioStreamBasicDescription);
 

          
@@ 135,7 135,7 @@ CoreAudioWriteStream::CoreAudioWriteStre
 
     if (m_d->err) {
         m_error = "CoreAudioWriteStream: Failed to create file: code " + codestr(m_d->err);
-        cerr << m_error << endl;
+//        cerr << m_error << endl;
         throw FailedToWriteFile(getPath());
     }
 

          
@@ 167,7 167,7 @@ CoreAudioWriteStream::CoreAudioWriteStre
     
     if (m_d->err) {
         m_error = "CoreAudioWriteStream: Error in setting client format: code " + codestr(m_d->err);
-        cerr << m_error << endl;
+//        cerr << m_error << endl;
 	ExtAudioFileDispose(m_d->file);
         throw FileOperationFailed(getPath(), "set client format");
     }

          
@@ 177,7 177,7 @@ CoreAudioWriteStream::CoreAudioWriteStre
     
     if (m_d->err) {
         m_error = "CoreAudioWriteStream: Error in initialising file writes: code " + codestr(m_d->err);
-        cerr << m_error << endl;
+//        cerr << m_error << endl;
 	ExtAudioFileDispose(m_d->file);
         throw FileOperationFailed(getPath(), "initialise file writes");
     }

          
@@ 191,7 191,7 @@ CoreAudioWriteStream::CoreAudioWriteStre
 CoreAudioWriteStream::~CoreAudioWriteStream()
 {
     if (m_d->file) {
-        cerr << "CoreAudioWriteStream::~CoreAudioWriteStream: disposing" << endl;
+//        cerr << "CoreAudioWriteStream::~CoreAudioWriteStream: disposing" << endl;
 	ExtAudioFileDispose(m_d->file);
     }
 }

          
@@ 211,7 211,7 @@ CoreAudioWriteStream::putInterleavedFram
     m_d->err = ExtAudioFileWrite(m_d->file, framesToWrite, &m_d->buffer);
     if (m_d->err) {
         m_error = "CoreAudioWriteStream: Error in encoder: code " + codestr(m_d->err);
-        cerr << m_error << endl;
+//        cerr << m_error << endl;
         throw FileOperationFailed(getPath(), "encode");
     }
 }

          
M src/SimpleWavFileWriteStream.cpp +0 -1
@@ 67,7 67,6 @@ SimpleWavFileWriteStream::SimpleWavFileW
     if (!*m_file) {
         delete m_file;
         m_file = 0;
-        cerr << "SimpleWavFileWriteStream: Failed to open output file for writing" << endl;
         m_error = string("Failed to open audio file '") +
             getPath() + "' for writing";
         throw FailedToWriteFile(getPath());

          
M src/WavFileWriteStream.cpp +0 -3
@@ 70,9 70,6 @@ WavFileWriteStream::WavFileWriteStream(T
     m_file = sf_open(getPath().c_str(), SFM_WRITE, &m_fileInfo);
 
     if (!m_file) {
-	cerr << "WavFileWriteStream::initialize: Failed to open output file for writing ("
-		  << sf_strerror(m_file) << ")" << endl;
-
         m_error = string("Failed to open audio file '") +
             getPath() + "' for writing";
         throw FailedToWriteFile(getPath());