Class: CoreAudio::AudioStreamBasicDescription
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- CoreAudio::AudioStreamBasicDescription
- Defined in:
- lib/macos/core_audio/audio_stream.rb
CoreAudioTypes.h collapse
- FormatFlagIsFloat =
(1 << 0)
- FormatFlagIsSignedInteger =
(1 << 2)
Instance Attribute Summary collapse
-
#channel_width ⇒ Integer
The number of bits per channel.
- #channels ⇒ Object
- #float? ⇒ Boolean
- #sample_rate ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#channel_width ⇒ Integer
Returns the number of bits per channel.
31 32 33 34 35 |
# File 'lib/macos/core_audio/audio_stream.rb', line 31 def channel_width=(bits) self[:mBitsPerChannel] = bits self[:mBytesPerFrame] = self[:mChannelsPerFrame] * bits / 8 self[:mBytesPerPacket] = self[:mBytesPerFrame] * self[:mFramesPerPacket] end |
#channels ⇒ Object
20 21 22 |
# File 'lib/macos/core_audio/audio_stream.rb', line 20 def channels self[:mChannelsPerFrame] end |
#float? ⇒ Boolean
39 40 41 |
# File 'lib/macos/core_audio/audio_stream.rb', line 39 def float? (self[:mFormatFlags] & FormatFlagIsFloat) != 0 end |
#sample_rate ⇒ Object
50 |
# File 'lib/macos/core_audio/audio_stream.rb', line 50 def sample_rate; self[:mSampleRate]; end |
Instance Method Details
#integer ⇒ Object
43 44 45 46 |
# File 'lib/macos/core_audio/audio_stream.rb', line 43 def integer self[:mFormatFlags] &= ~FormatFlagIsFloat self[:mFormatFlags] |= FormatFlagIsSignedInteger end |