Class: Awaaz::Extensions::Samplerate::SRC_DATA
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- Awaaz::Extensions::Samplerate::SRC_DATA
- Defined in:
- lib/awaaz/extensions/samplerate.rb
Overview
Structure representing the parameters for a sample rate conversion operation.
Mirrors the C struct ‘SRC_DATA` from libsamplerate.
Instance Attribute Summary collapse
-
#data_in ⇒ FFI::Pointer
Pointer to the input audio buffer.
-
#data_out ⇒ FFI::Pointer
Pointer to the output audio buffer.
-
#end_of_input ⇒ Integer
Flag (0 or 1) indicating whether this is the last block of input data.
-
#input_frames ⇒ Integer
Number of input frames.
-
#input_frames_used ⇒ Integer
Number of input frames actually used.
-
#output_frames ⇒ Integer
Number of output frames allocated.
-
#output_frames_gen ⇒ Integer
Number of output frames generated.
-
#src_ratio ⇒ Float
Conversion ratio (output_sample_rate / input_sample_rate).
Instance Attribute Details
#data_in ⇒ FFI::Pointer
Returns Pointer to the input audio buffer.
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/awaaz/extensions/samplerate.rb', line 43 class SRC_DATA < FFI::Struct layout :data_in, :pointer, :data_out, :pointer, :input_frames, :long, :output_frames, :long, :input_frames_used, :long, :output_frames_gen, :long, :end_of_input, :int, :src_ratio, :double end |
#data_out ⇒ FFI::Pointer
Returns Pointer to the output audio buffer.
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/awaaz/extensions/samplerate.rb', line 43 class SRC_DATA < FFI::Struct layout :data_in, :pointer, :data_out, :pointer, :input_frames, :long, :output_frames, :long, :input_frames_used, :long, :output_frames_gen, :long, :end_of_input, :int, :src_ratio, :double end |
#end_of_input ⇒ Integer
Returns Flag (0 or 1) indicating whether this is the last block of input data.
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/awaaz/extensions/samplerate.rb', line 43 class SRC_DATA < FFI::Struct layout :data_in, :pointer, :data_out, :pointer, :input_frames, :long, :output_frames, :long, :input_frames_used, :long, :output_frames_gen, :long, :end_of_input, :int, :src_ratio, :double end |
#input_frames ⇒ Integer
Returns Number of input frames.
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/awaaz/extensions/samplerate.rb', line 43 class SRC_DATA < FFI::Struct layout :data_in, :pointer, :data_out, :pointer, :input_frames, :long, :output_frames, :long, :input_frames_used, :long, :output_frames_gen, :long, :end_of_input, :int, :src_ratio, :double end |
#input_frames_used ⇒ Integer
Returns Number of input frames actually used.
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/awaaz/extensions/samplerate.rb', line 43 class SRC_DATA < FFI::Struct layout :data_in, :pointer, :data_out, :pointer, :input_frames, :long, :output_frames, :long, :input_frames_used, :long, :output_frames_gen, :long, :end_of_input, :int, :src_ratio, :double end |
#output_frames ⇒ Integer
Returns Number of output frames allocated.
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/awaaz/extensions/samplerate.rb', line 43 class SRC_DATA < FFI::Struct layout :data_in, :pointer, :data_out, :pointer, :input_frames, :long, :output_frames, :long, :input_frames_used, :long, :output_frames_gen, :long, :end_of_input, :int, :src_ratio, :double end |
#output_frames_gen ⇒ Integer
Returns Number of output frames generated.
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/awaaz/extensions/samplerate.rb', line 43 class SRC_DATA < FFI::Struct layout :data_in, :pointer, :data_out, :pointer, :input_frames, :long, :output_frames, :long, :input_frames_used, :long, :output_frames_gen, :long, :end_of_input, :int, :src_ratio, :double end |
#src_ratio ⇒ Float
Returns Conversion ratio (output_sample_rate / input_sample_rate).
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/awaaz/extensions/samplerate.rb', line 43 class SRC_DATA < FFI::Struct layout :data_in, :pointer, :data_out, :pointer, :input_frames, :long, :output_frames, :long, :input_frames_used, :long, :output_frames_gen, :long, :end_of_input, :int, :src_ratio, :double end |