Class: Awaaz::Extensions::Soundfile::SF_INFO
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- Awaaz::Extensions::Soundfile::SF_INFO
- Defined in:
- lib/awaaz/extensions/soundfile.rb
Overview
Structure containing metadata about an audio file.
Mirrors the C struct ‘SF_INFO` from libsndfile.
Instance Attribute Summary collapse
-
#channels ⇒ Integer
Number of audio channels.
-
#format ⇒ Integer
Format identifier of the audio file.
-
#frames ⇒ Integer
Total number of frames in the file.
-
#samplerate ⇒ Integer
Sample rate of the audio file (Hz).
-
#sections ⇒ Integer
Number of sections in the file.
-
#seekable ⇒ Integer
Whether the file is seekable (1) or not (0).
Instance Attribute Details
#channels ⇒ Integer
Returns Number of audio channels.
44 45 46 47 48 49 50 51 |
# File 'lib/awaaz/extensions/soundfile.rb', line 44 class SF_INFO < FFI::Struct layout :frames, :long_long, :samplerate, :int, :channels, :int, :format, :int, :sections, :int, :seekable, :int end |
#format ⇒ Integer
Returns Format identifier of the audio file.
44 45 46 47 48 49 50 51 |
# File 'lib/awaaz/extensions/soundfile.rb', line 44 class SF_INFO < FFI::Struct layout :frames, :long_long, :samplerate, :int, :channels, :int, :format, :int, :sections, :int, :seekable, :int end |
#frames ⇒ Integer
Returns Total number of frames in the file.
44 45 46 47 48 49 50 51 |
# File 'lib/awaaz/extensions/soundfile.rb', line 44 class SF_INFO < FFI::Struct layout :frames, :long_long, :samplerate, :int, :channels, :int, :format, :int, :sections, :int, :seekable, :int end |
#samplerate ⇒ Integer
Returns Sample rate of the audio file (Hz).
44 45 46 47 48 49 50 51 |
# File 'lib/awaaz/extensions/soundfile.rb', line 44 class SF_INFO < FFI::Struct layout :frames, :long_long, :samplerate, :int, :channels, :int, :format, :int, :sections, :int, :seekable, :int end |
#sections ⇒ Integer
Returns Number of sections in the file.
44 45 46 47 48 49 50 51 |
# File 'lib/awaaz/extensions/soundfile.rb', line 44 class SF_INFO < FFI::Struct layout :frames, :long_long, :samplerate, :int, :channels, :int, :format, :int, :sections, :int, :seekable, :int end |
#seekable ⇒ Integer
Returns Whether the file is seekable (1) or not (0).
44 45 46 47 48 49 50 51 |
# File 'lib/awaaz/extensions/soundfile.rb', line 44 class SF_INFO < FFI::Struct layout :frames, :long_long, :samplerate, :int, :channels, :int, :format, :int, :sections, :int, :seekable, :int end |