Class: Awaaz::Extensions::Samplerate::SRC_DATA

Inherits:
FFI::Struct
  • Object
show all
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

Instance Attribute Details

#data_inFFI::Pointer

Returns Pointer to the input audio buffer.

Returns:

  • (FFI::Pointer)

    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_outFFI::Pointer

Returns Pointer to the output audio buffer.

Returns:

  • (FFI::Pointer)

    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_inputInteger

Returns Flag (0 or 1) indicating whether this is the last block of input data.

Returns:

  • (Integer)

    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_framesInteger

Returns Number of input frames.

Returns:

  • (Integer)

    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_usedInteger

Returns Number of input frames actually used.

Returns:

  • (Integer)

    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_framesInteger

Returns Number of output frames allocated.

Returns:

  • (Integer)

    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_genInteger

Returns Number of output frames generated.

Returns:

  • (Integer)

    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_ratioFloat

Returns Conversion ratio (output_sample_rate / input_sample_rate).

Returns:

  • (Float)

    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