From 5378bbbb2793344de3bb360a29583bbee2137e9b Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Wed, 7 Oct 2020 18:10:34 -0700 Subject: [PATCH] Timeline: Improve error message for sf_open create. --- timeline/src/Engine/Audio_File_SF.C | 5 ++++- timeline/src/Engine/Track.C | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/timeline/src/Engine/Audio_File_SF.C b/timeline/src/Engine/Audio_File_SF.C index a1ef61f..4c57a18 100644 --- a/timeline/src/Engine/Audio_File_SF.C +++ b/timeline/src/Engine/Audio_File_SF.C @@ -112,7 +112,10 @@ Audio_File_SF::create ( const char *filename, nframes_t samplerate, int channels const Audio_File::format_desc *fd = Audio_File::find_format( Audio_File_SF::supported_formats, format ); if ( ! fd ) + { + DMESSAGE( "Unsupported capture format: %s", format ); return (Audio_File_SF *)1; + } si.samplerate = samplerate; si.channels = channels; @@ -125,7 +128,7 @@ Audio_File_SF::create ( const char *filename, nframes_t samplerate, int channels if ( ! ( out = sf_open( filepath, SFM_WRITE, &si ) ) ) { - printf( "couldn't create soundfile.\n" ); + WARNING( "couldn't create soundfile \"%s\": libsndfile says: %s", filepath, sf_strerror(NULL) ); free( name ); return NULL; } diff --git a/timeline/src/Engine/Track.C b/timeline/src/Engine/Track.C index 4bfdb5f..579eb53 100644 --- a/timeline/src/Engine/Track.C +++ b/timeline/src/Engine/Track.C @@ -287,7 +287,7 @@ Track::record ( Capture *c, nframes_t frame ) free( pat ); if ( ! c->audio_file ) - FATAL( "Could not create file for new capture!" ); + FATAL( "Could not create file for new capture! (%s)", pat ); /* open it again for reading in the GUI thread */ // Audio_File *af = Audio_File::from_file( c->audio_file->name() );