Class: TagLib::AudioProperties
- Inherits:
-
Data
- Object
- Data
- TagLib::AudioProperties
- Defined in:
- lib/taglib_simple/audio_properties.rb
Overview
Represents the audio properties of a media file
Instance Attribute Summary collapse
-
#audio_length ⇒ Integer
readonly
The length of the audio in milliseconds.
-
#bitrate ⇒ Integer
readonly
The bitrate of the audio in kb/s.
-
#sample_rate ⇒ Integer
readonly
The sample rate in Hz.
Class Method Summary collapse
Instance Attribute Details
#audio_length ⇒ Integer (readonly)
Returns The length of the audio in milliseconds.
|
# File 'lib/taglib_simple/audio_properties.rb', line 9
|
#bitrate ⇒ Integer (readonly)
Returns The bitrate of the audio in kb/s.
|
# File 'lib/taglib_simple/audio_properties.rb', line 12
|
#sample_rate ⇒ Integer (readonly)
Returns The sample rate in Hz.
|
# File 'lib/taglib_simple/audio_properties.rb', line 15
|
Class Method Details
.read(filename, audio_properties: true) ⇒ AudioProperties
25 26 27 28 29 |
# File 'lib/taglib_simple/audio_properties.rb', line 25 def read(filename, audio_properties: true) raise ArgumentError, 'audio_properties must be one of :average, :fast, :accurate' unless audio_properties Taglib::MediaFile.open(filename, audio_properties:, &:audio_properties) end |