Class: CoreAudio::AudioBuffer
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- CoreAudio::AudioBuffer
- Defined in:
- lib/macos/core_audio/audio_types.rb
Instance Method Summary collapse
-
#bytes ⇒ String
The raw bytes.
- #bytesize ⇒ Object
-
#samples_float(bytes_per_channel) ⇒ Array<Float>
An array of samples, converted to Float.
-
#samples_int(bytes_per_channel) ⇒ Array<Integer>
An array of samples, converted to signed integers.
Instance Method Details
#bytes ⇒ String
Returns the raw bytes.
8 9 10 |
# File 'lib/macos/core_audio/audio_types.rb', line 8 def bytes self[:mData].get_bytes(0, self[:mDataByteSize]) end |
#bytesize ⇒ Object
12 13 14 |
# File 'lib/macos/core_audio/audio_types.rb', line 12 def bytesize self[:mDataByteSize] end |
#samples_float(bytes_per_channel) ⇒ Array<Float>
Returns an array of samples, converted to Float.
22 23 24 |
# File 'lib/macos/core_audio/audio_types.rb', line 22 def samples_float(bytes_per_channel) self[:mData].get_array_of_float32(0, self[:mDataByteSize]/bytes_per_channel) end |
#samples_int(bytes_per_channel) ⇒ Array<Integer>
Returns an array of samples, converted to signed integers.
17 18 19 |
# File 'lib/macos/core_audio/audio_types.rb', line 17 def samples_int(bytes_per_channel) self[:mData].get_array_of_int16(0, self[:mDataByteSize]/bytes_per_channel) end |