sf_print_audio_file_info   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/external/sndfile.xtm

Implementation

(bind-func sf_print_audio_file_info
  "print info about an audio file"
  (lambda (filename)
    (let ((info:SF_INFO* (salloc))
          (audiofile (sf_open filename SFM_READ info))
          (channels (sf_channels info)))
      (if (null? audiofile)
          (begin (printf "Bad audio file!\n")
                 void)
          (let ((nframes (sf_frames info))
                (rate (convert (sf_samplerate info)))
                (nseconds (/ nframes rate)))
            (printf "---------------\n")
            (printf "filename: %s\n" filename)
            (printf "samplerate: %d\n" rate)
            (printf "channels: %d\n" (sf_channels info))
            (printf "format: %#x\n" (sf_format info))
            (printf "frames: %lld\n" nframes)
            (if (< nframes (* 44100 60 1))
                (printf "seconds: %f\n" nseconds)
                (if (< nframes (* 44100 60 60))
                    (printf "minutes: %f\n" (/ (convert nseconds double) 60.))
                    (printf "hours: %f\n" (/ (convert nseconds double) (* 60. 60.)))))
            (let ((loops:SF_LOOP_INFO* (alloc))
                  (lp1 (sf_command audiofile SFC_GET_LOOP_INFO (cast loops i8*) 44)))
              (if (= lp1 SF_TRUE)
                  (printf "loop-mode: %d - bpm(%f)\n" (tref loops 2) (ftod (tref loops 4)))
                  (printf "loop-mode:\n")))
            (let ((inst:SF_INSTRUMENT* (alloc))
                  (lp2 (sf_command audiofile SFC_GET_INSTRUMENT (cast inst i8*) 270)))
              (if (= lp2 SF_TRUE)
                  (printf "nframes loops: %d\n" (tref inst 7))
                  (printf "nframes loops: 0\n")))
            (sf_close audiofile)
            void)))))


Back to Index

Similar Entries

  • AudioBuffer    xtlang
  • AudioBuffer    xtlang
  • AudioBuffer    xtlang
  • AudioBuffer    xtlang
  • AudioBuffer    xtlang
  • AudioBuffer_concat    xtlang
  • AudioBuffer_cstring    xtlang
  • AudioBuffer_data_b64    xtlang
  • AudioBuffer_data_b64_cstring    xtlang
  • AudioBuffer_from_aiff    xtlang
  • AudioBuffer_from_wave    xtlang
  • AudioBuffer_malloc    xtlang
  • AudioBuffer_read    xtlang
  • AudioBuffer_read    xtlang
  • AudioBuffer_read_interp    xtlang
  • AudioBuffer_read_interp_mix    xtlang
  • AudioBuffer_read_interp_pw    xtlang
  • AudioBuffer_read_looped    xtlang
  • AudioBuffer_read_looped    xtlang
  • AudioBuffer_set_data_b64    xtlang
  • AudioBuffer_shared_data    xtlang
  • CprintP    xtlang
  • CprintPd    xtlang
  • CprintPr    xtlang
  • CprintR    xtlang
  • PaDeviceInfo_print    xtlang
  • PaDeviceInfo_toString    xtlang
  • PaHostApiInfo_print    xtlang
  • PaHostApiInfo_toString    xtlang
  • PaHostErrorInfo_print    xtlang
  • PaHostErrorInfo_toString    xtlang
  • PaStreamCallbackTimeInfo_print    xtlang
  • PaStreamCallbackTimeInfo_toString    xtlang
  • PaStreamInfo_print    xtlang
  • PaStreamInfo_toString    xtlang
  • PaStreamParameters_print    xtlang
  • ShaderProgram_print_info_log    xtlang
  • Shader_print_info_log    xtlang
  • Vprint    xtlang
  • _playbin_bus_call:GstBusFunc    xtlang
  • _print_interface_addresses    xtlang
  • aiProcess_PreTransformVertices    scheme
  • aiProcess_TransformUVCoords    scheme
  • ai_print_export_formats    xtlang
  • analogue_remove_file    xtlang
  • audio_64bit    xtlang
  • audio_callback:PaStreamCallback    xtlang
  • audio_callback:PaStreamCallback    xtlang
  • audiofile_16bitPCM_to_sample_be    xtlang
  • audiofile_16bitPCM_to_sample_le    xtlang
  • audiofile_24bitPCM_to_sample_be    xtlang
  • audiofile_24bitPCM_to_sample_le    xtlang
  • audiofile_aiff_read_samples    xtlang
  • audiofile_copy_samples    xtlang
  • audiofile_float_to_sample_be    xtlang
  • audiofile_float_to_sample_le    xtlang
  • audiofile_read_samples    xtlang
  • audiofile_wave_read_samples    xtlang
  • call-with-input-file    scheme
  • call-with-output-file    scheme
  • cerberus_remove_file    xtlang
  • chunked_printf    xtlang
  • console_print    xtlang
  • cpTransformAxialScale    xtlang
  • cpTransformBB    xtlang
  • cpTransformBoneScale    xtlang
  • cpTransformInverse    xtlang
  • cpTransformMult    xtlang
  • cpTransformNew    xtlang
  • cpTransformNewTranspose    xtlang
  • cpTransformOrtho    xtlang
  • cpTransformPoint    xtlang
  • cpTransformRigid    xtlang
  • cpTransformRigidInverse    xtlang
  • cpTransformRotate    xtlang
  • cpTransformScale    xtlang
  • cpTransformTranslate    xtlang
  • cpTransformVect    xtlang
  • cpTransformWrap    xtlang
  • cpTransformWrapInverse    xtlang
  • curl_print_version    xtlang
  • db_print_column    xtlang
  • file->string    scheme
  • file-exists?    scheme
  • file_size    xtlang
  • file_word_count    xtlang
  • filename-from-path    scheme
  • filename-strip-extension    scheme
  • fill_buffer_with_file    xtlang
  • fits-file-print    xtlang
  • fits-file-print    xtlang
  • fits-open-file    xtlang
  • fits-open-file    xtlang
  • fleet_print_machines    xtlang
  • fleet_print_state    xtlang
  • fleet_print_state    xtlang
  • fleet_print_unit    xtlang
  • fleet_print_unit_state    xtlang
  • fleet_print_units    xtlang
  • g_print_value_type    xtlang
  • get_file_name    xtlang
  • ghttp_print_request_body    xtlang
  • ghttp_print_request_full    xtlang
  • ghttp_print_request_headers    xtlang
  • gl_print_driver_info    xtlang
  • gl_print_driver_info    xtlang
  • gl_print_driver_info    xtlang
  • gl_print_error    xtlang
  • gl_print_error    xtlang
  • gl_print_error    xtlang
  • gl_print_error    xtlang
  • gl_print_error_no_msg    xtlang
  • gl_print_error_with_msg    xtlang
  • glfw_cursor_position_callback:GLFWcursorposfun    xtlang
  • glfw_print_primary_monitor_details    xtlang
  • glfw_print_version_string    xtlang
  • glfw_print_video_mode_details    xtlang
  • glfw_set_compatibility_profile    xtlang
  • glfw_set_core_profile    xtlang
  • glfw_window_focus_callback:GLFWwindowfocusfun    xtlang
  • glfw_window_position_callback:GLFWwindowposfun    xtlang
  • global_transform2d    xtlang
  • godot_variant_new_transform    xtlang
  • godot_variant_new_transform2d    xtlang
  • impc:aot:compile-xtm-file    scheme
  • impc:aot:print-compilation-details    scheme
  • impc:compiler:print-already-bound-error    scheme
  • impc:compiler:print-bad-arity-error    scheme
  • impc:compiler:print-bad-numeric-value-error    scheme
  • impc:compiler:print-bad-type-error    scheme
  • impc:compiler:print-bad-type-error-with-ast    scheme
  • impc:compiler:print-badly-formed-expression-error    scheme
  • impc:compiler:print-bind-func-details-to-log    scheme
  • impc:compiler:print-binding-details-to-log    scheme
  • impc:compiler:print-cannot-expand-non-generic-error    scheme
  • impc:compiler:print-compiler-error    scheme
  • impc:compiler:print-compiler-failed-error    scheme
  • impc:compiler:print-compiler-warning    scheme
  • impc:compiler:print-constraint-error    scheme
  • impc:compiler:print-could-not-resolve-generic-type-error    scheme
  • impc:compiler:print-could-not-resolve-type-error    scheme
  • impc:compiler:print-could-not-resolve-types    scheme
  • impc:compiler:print-could-not-resolve-types_find-expr    scheme
  • impc:compiler:print-double-colon-error    scheme
  • impc:compiler:print-dylib-loading-details-to-log    scheme
  • impc:compiler:print-expansion-arity-error    scheme
  • impc:compiler:print-if-type-conflict-error    scheme
  • impc:compiler:print-index-oob-error    scheme
  • impc:compiler:print-lib-binding-details-to-log    scheme
  • impc:compiler:print-missing-generic-type-error    scheme
  • impc:compiler:print-missing-identifier-error    scheme
  • impc:compiler:print-needs-zone-delay-error    scheme
  • impc:compiler:print-needs-zone-size-error    scheme
  • impc:compiler:print-no-redefinitions-error    scheme
  • impc:compiler:print-no-retval-error    scheme
  • impc:compiler:print-no-scheme-stub-notification    scheme
  • impc:compiler:print-no-valid-forms-for-generic-error    scheme
  • impc:compiler:print-not-during-aot-error    scheme
  • impc:compiler:print-polying-details-to-log    scheme
  • impc:compiler:print-shadow-var-error    scheme
  • impc:compiler:print-type-conflict-error    scheme
  • impc:compiler:print-type-mismatch-error    scheme
  • impc:compiler:print-unsupported-conversion-error    scheme
  • impc:compiler:print-variable-not-marked-as-free-error    scheme
  • impc:ir:pretty-print-type    scheme
  • impc:pretty-print-vars    macro
  • impc:ti:first-transform    scheme
  • impc:ti:fprintf-check    scheme
  • impc:ti:genericfunc-pretty-print    scheme
  • impc:ti:polyfunc-pretty-print    scheme
  • impc:ti:polytype-pretty-print    scheme
  • impc:ti:print-builtin-cache    scheme
  • impc:ti:print-closure-cache    scheme
  • impc:ti:print-genericfunc-cache    scheme
  • impc:ti:print-generictype-cache    scheme
  • impc:ti:print-globalvar-cache    scheme
  • impc:ti:print-namedtype-cache    scheme
  • impc:ti:print-nativefunc-cache    scheme
  • impc:ti:print-polyfunc-cache    scheme
  • impc:ti:print-polytype-cache    scheme
  • impc:ti:print-typealias-cache    scheme
  • impc:ti:print-xtmacro-cache    scheme
  • impc:ti:printf-check    scheme
  • impc:ti:println    scheme
  • impc:ti:println2    scheme
  • impc:ti:sprintf-check    scheme
  • impc:ti:sprintln    scheme
  • impc:ti:sprintln2    scheme
  • json_object_print_keys    xtlang
  • json_print_type    xtlang
  • kinect_print_body    xtlang
  • lilv_print_all_lv2_plugins    xtlang
  • lilv_print_all_plugin_ports    xtlang
  • llvm:compile-ir-and-print    scheme
  • log-info    scheme
  • mprint    xtlang
  • mprint    xtlang
  • mprint    xtlang
  • mprint    xtlang
  • myprint    xtlang
  • myprint    xtlang
  • myprint    xtlang
  • nn_println_strerror    xtlang
  • nn_println_strerror    xtlang
  • pa_print_devices    xtlang
  • playbin_bus_call:GstBusFunc    xtlang
  • pm_print_devices    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print    xtlang
  • print-load    scheme
  • print-str-sym    xtlang
  • print-with-colors    macro
  • printYourArgs    xtlang
  • print_all_devices    xtlang
  • print_audio_state    xtlang
  • print_audio_state    xtlang
  • print_device_feature_report    xtlang
  • print_interface_addresses    xtlang
  • print_json_t    xtlang
  • print_mersenne_primes    xtlang
  • print_midi_devices    xtlang
  • print_particle    xtlang
  • print_planet    xtlang
  • print_program_info_log    xtlang
  • print_response    xtlang
  • print_response    xtlang
  • print_return    xtlang
  • print_shader_info_log    xtlang
  • print_space    xtlang
  • print_walker    xtlang
  • print_walker_array    xtlang
  • print_xtmmodel    xtlang
  • printer    xtlang
  • qr_code_print    xtlang
  • rmap_helper_lst_sym_transform    scheme
  • rtmidi_print_ports    xtlang
  • sampler-parse-filename    scheme
  • sampler-parse-midinote-filename    scheme
  • sampler-parse-spn-filename    scheme
  • set_sampler_audiobuffer    xtlang
  • sf_channels    xtlang
  • sf_channels_from_file    xtlang
  • sf_format    xtlang
  • sf_frames    xtlang
  • sf_frames_from_file    xtlang
  • sf_read_file_into_buffer    xtlang
  • sf_samplerate    xtlang
  • sf_samples_from_file    xtlang
  • sf_sections    xtlang
  • sf_seekable    xtlang
  • sf_set_channels    xtlang
  • sf_set_format    xtlang
  • sf_set_frames    xtlang
  • sf_set_samplerate    xtlang
  • sf_set_sections    xtlang
  • sf_set_seekable    xtlang
  • sfixed    xtlang
  • string_list_from_file    xtlang
  • sys:file-path-components    scheme
  • sys:print-interface-addresses    scheme
  • sys_file_append    xtlang
  • sys_file_close    xtlang
  • sys_file_copy    xtlang
  • sys_file_datasync    xtlang
  • sys_file_datasync    xtlang
  • sys_file_eof    xtlang
  • sys_file_flush    xtlang
  • sys_file_getc    xtlang
  • sys_file_gets    xtlang
  • sys_file_link    xtlang
  • sys_file_mktemp    xtlang
  • sys_file_open    xtlang
  • sys_file_open_stderr    xtlang
  • sys_file_open_stdin    xtlang
  • sys_file_open_stdout    xtlang
  • sys_file_putc    xtlang
  • sys_file_puts    xtlang
  • sys_file_read    xtlang
  • sys_file_remove    xtlang
  • sys_file_rename    xtlang
  • sys_file_seek    xtlang
  • sys_file_sync    xtlang
  • sys_file_ungetc    xtlang
  • sys_file_write    xtlang
  • sys_filepath_root    xtlang
  • sys_g_file_test    xtlang
  • testprint    xtlang
  • testprint    xtlang
  • testprint    xtlang
  • v4fabsf    xtlang
  • vcosf4    xtlang
  • vcosf4    xtlang
  • vprint    xtlang
  • vprint    xtlang
  • vprint    xtlang
  • vprint    xtlang
  • vprint    xtlang
  • vprint    xtlang
  • vprint    xtlang
  • vprint    xtlang
  • with-input-from-file    scheme
  • with-input-output-from-to-files    scheme
  • with-output-to-file    scheme
  • world_ascii_print    xtlang
  • world_basic_print    xtlang
  • xobj_print_class    xtlang
  • xobj_print_classes    xtlang
  • xtm_vg_print_error    xtlang
  • xtmtest-print-results    scheme
  • xtmtest-print-results    scheme