static void usage_exit (const char *progname, int exit_code) { printf ("\nUsage :\n %s [options] <file>\n\nOptions:\n", progname) ; puts ( " --bext-description Print the 'bext' description.\n" " --bext-originator Print the 'bext; originator info.\n" " --bext-orig-ref Print the 'bext' origination reference.\n" " --bext-umid Print the 'bext' UMID.\n" " --bext-orig-date Print the 'bext' origination date.\n" " --bext-orig-time Print the 'bext' origination time.\n" " --bext-coding-hist Print the 'bext' coding history.\n" ) ; puts ( " --str-title Print the title metadata.\n" " --str-copyright Print the copyright metadata.\n" " --str-artist Print the artist metadata.\n" " --str-comment Print the comment metadata.\n" " --str-date Print the creation date metadata.\n" " --str-album Print the album metadata.\n" " --str-license Print the license metadata.\n" ) ; printf ("Using %s.\n\n", sf_version_string ()) ; exit (exit_code) ; } /* usage_exit */
static void usage_exit (void) { printf ("Usage : %s <filename> <filename>\n", progname) ; printf (" Compare the PCM data of two sound files.\n\n") ; printf ("Using %s.\n\n", sf_version_string ()) ; exit (1) ; } /* usage_exit */
static void usage_exit (void) { puts ("\nUsage : sndfile-interleave <input 1> <input 2> ... -o <output file>\n") ; puts ("Merge two or more mono files into a single multi-channel file.\n") ; printf ("Using %s.\n\n", sf_version_string ()) ; exit (1) ; } /* usage_exit */
const char* printVersionInfo(void) { fprintf(stdout, BLUE_TEXT("Khronos version: %s (%s)\n"), KHRONOS_VERSION, KHRONOS_VERSION_STATE); fprintf(stdout, "Khronos submodule version information:\n"); fprintf(stdout, "\t- %s\n", Pa_GetVersionText()); fprintf(stdout, "\t- %s (%s) %s\n", TRITIUM_PROJECT_NAME, TRITIUM_PROJECT_PREFIX, TRITIUM_PROJECT_VERSION); fprintf(stdout, "\t- %s\n", sf_version_string()); return ""; }
int main (int argc, char *argv []) { if (argc < 2) { printf ("\nUsage : %s <input sound file>\n\n", program_name (argv [0])) ; printf (" Using %s.\n\n", sf_version_string ()) ; #if (OS_IS_WIN32 == 1) printf ("This is a Unix style command line application which\n" "should be run in a MSDOS box or Command Shell window.\n\n") ; printf ("Sleeping for 5 seconds before exiting.\n\n") ; Sleep (5 * 1000) ; #endif return 1 ; } ; #if defined (__ANDROID__) puts ("*** Playing sound not yet supported on Android.") ; puts ("*** Please feel free to submit a patch.") ; return 1 ; #elif defined (__linux__) #if HAVE_ALSA_ASOUNDLIB_H if (access ("/proc/asound/cards", R_OK) == 0) alsa_play (argc, argv) ; else #endif opensoundsys_play (argc, argv) ; #elif defined (__FreeBSD_kernel__) || defined (__FreeBSD__) opensoundsys_play (argc, argv) ; #elif (defined (__MACH__) && defined (__APPLE__) && OSX_DARWIN_VERSION <= 11) macosx_play (argc, argv) ; #elif HAVE_SNDIO_H sndio_play (argc, argv) ; #elif (defined (sun) && defined (unix)) solaris_play (argc, argv) ; #elif (OS_IS_WIN32 == 1) win32_play (argc, argv) ; #elif (defined (__MACH__) && defined (__APPLE__) && OSX_DARWIN_VERSION > 11) printf ("OS X 10.8 and later have a new Audio API.\n") ; printf ("Someone needs to write code to use that API.\n") ; return 1 ; #elif defined (__BEOS__) printf ("This program cannot be compiled on BeOS.\n") ; printf ("Instead, compile the file sfplay_beos.cpp.\n") ; return 1 ; #else puts ("*** Playing sound not yet supported on this platform.") ; puts ("*** Please feel free to submit a patch.") ; return 1 ; #endif return 0 ; } /* main */
static void usage_exit (void) { puts ("\nUsage : sndfile-deinterleave <filename>\n") ; puts ( "Split a mutli-channel file into a set of mono files.\n" "\n" "If the input file is named 'a.wav', the output files will be named\n" "a_00.wav, a_01.wav and so on.\n" ) ; printf ("Using %s.\n\n", sf_version_string ()) ; exit (1) ; } /* usage_exit */
std::string AudioFileSndfile::sndfileError(int errorNumber, const std::string& userMessage) const { const std::string libraryMessage = sf_error_number(errorNumber); char logInfo[LOGINFO_MAX_SIZE]; sf_command(_handle.get(), SFC_GET_LOG_INFO, logInfo, LOGINFO_MAX_SIZE); LOG(INFO, "Library error detailed information" << "\n\n" << "Sound file: " << _path << '\n' << "Library reports: " << libraryMessage << '\n' << "Library version: " << sf_version_string() << '\n' << "Library log follows:\n" << logInfo); return userMessage + ": " + libraryMessage; }
int main (void) { SF_FORMAT_INFO info ; SF_INFO sfinfo ; int format, major_count, subtype_count, m, s ; memset (&sfinfo, 0, sizeof (sfinfo)) ; printf ("Version : %s\n\n", sf_version_string ()) ; sf_command (NULL, SFC_GET_FORMAT_MAJOR_COUNT, &major_count, sizeof (int)) ; sf_command (NULL, SFC_GET_FORMAT_SUBTYPE_COUNT, &subtype_count, sizeof (int)) ; sfinfo.channels = 1 ; for (m = 0 ; m < major_count ; m++) { info.format = m ; sf_command (NULL, SFC_GET_FORMAT_MAJOR, &info, sizeof (info)) ; printf ("%s (extension \"%s\")\n", info.name, info.extension) ; format = info.format ; for (s = 0 ; s < subtype_count ; s++) { info.format = s ; sf_command (NULL, SFC_GET_FORMAT_SUBTYPE, &info, sizeof (info)) ; format = (format & SF_FORMAT_TYPEMASK) | info.format ; sfinfo.format = format ; if (sf_format_check (&sfinfo)) printf (" %s\n", info.name) ; } ; puts ("") ; } ; puts ("") ; return 0 ; } /* main */
static void usage_exit (const char *progname) { printf ("Usage :\n %s <file> ...\n", progname) ; printf (" Prints out information about one or more sound files.\n\n") ; printf (" %s -i <file>\n", progname) ; printf (" Prints out the instrument data for the given file.\n\n") ; printf (" %s -b <file>\n", progname) ; printf (" Prints out the broadcast WAV info for the given file.\n\n") ; #if (defined (_WIN32) || defined (WIN32)) printf ("This is a Unix style command line application which\n" "should be run in a MSDOS box or Command Shell window.\n\n") ; printf ("Sleeping for 5 seconds before exiting.\n\n") ; fflush (stdout) ; /* This is the officially blessed by microsoft way but I can't get ** it to link. ** Sleep (15) ; ** Instead, use this: */ Sleep (5 * 1000) ; #endif printf ("Using %s.\n\n", sf_version_string ()) ; exit (0) ; } /* usage_exit */