Class: Id3Tags::M4A

Inherits:
Object
  • Object
show all
Includes:
FieldsAccessors, M4AFields, M4AFieldsGetter, M4AFieldsSetter
Defined in:
lib/id3_tags/m4a.rb

Instance Method Summary collapse

Instance Method Details

#read_tags_from(file_path) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/id3_tags/m4a.rb', line 13

def read_tags_from(file_path)
  attrs = {}
  TagLib::MP4::File.open(file_path) do |file|
    attrs.merge! get_tag_fields(file)
    attrs.merge! get_audio_properties_fields(file)
  end
  attrs.symbolize_keys
end

#write_tags_to(file_path, attrs = {}) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/id3_tags/m4a.rb', line 22

def write_tags_to(file_path, attrs = {})
  attrs.symbolize_keys!
  TagLib::MP4::File.open(file_path) do |file|
    set_tag_fields! file, attrs
    file.save
  end
end