user1260470
user1260470

Reputation: 21

How to read packet sizes in Opus file?

I'm encoding a speech sample (in *.WAV format) to *.opus file, using "opusenc" with VBR option enabled. At successful completion of the encoding, the opus encoder returns a report briefing XXX many packets in YY pages and ranges of packet sizes in bytes.

However, I need more information than this. I want to know the actual byte count for each packet in the resulting opus file, of course in the correct order of the encoded packets.

Can anyone help me on achieving the goal with minimal programming? Is there any opus file analyzer or player to provide the information I need?

Upvotes: 2

Views: 850

Answers (1)

MZaragoza
MZaragoza

Reputation: 10111

if you are trying to get the file size you can try this

class Upload < ActiveRecord::Base
  belongs_to :binary,  :dependent => :destroy
  attr_accessor :file_data
  def before_create
    input = self.file_data
    @binary = Binary.create(:file_data => input)
    self.binary_id = @binary.id
    self.filename = input.original_filename
    self.content_type = input.content_type.chomp
    self.size = @binary.data.size
  end
end

Upvotes: 0

Related Questions