about summary refs log tree commit diff
path: root/lib/paperclip/audio_transcoder.rb
blob: b84eb7650e9895dc498b42f189cd013c22677451 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

module Paperclip
  class AudioTranscoder < Paperclip::Processor
    def make
      max_aud_len = (ENV['MAX_AUDIO_LENGTH'] || 60.0).to_f

      meta = ::Av.cli.identify(@file.path)
      #attachment.instance.file_file_name    = 'media.m4a'
      #attachment.instance.file_content_type = 'audio/mp4'
      attachment.instance.type              = MediaAttachment.types[:video]

      Paperclip::Transcoder.make(file, options, attachment)
    end
  end
end