【问题标题】:How to read packet sizes in Opus file?如何读取 Opus 文件中的数据包大小?
【发布时间】:2013-09-19 22:13:43
【问题描述】:

我正在使用启用 VBR 选项的“opusenc”将语音样本(*.WAV 格式)编码为 *.opus 文件。在成功完成编码后,opus 编码器返回一个报告,简要介绍 XXX 个 YY 页中的许多数据包以及数据包大小范围(以字节为单位)。

但是,我需要比这更多的信息。我想知道生成的 opus 文件中每个数据包的实际字节数,当然是按照编码数据包的正确顺序。

谁能帮助我以最少的编程实现目标?是否有任何 opus 文件分析器或播放器来提供我需要的信息?

【问题讨论】:

  • 您能否展示一些代码,以便针对您的问题提供更具体的答案

标签: encoding packet opus


【解决方案1】:

如果你想获取文件大小,你可以试试这个

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

【讨论】:

  • 还没有代码。 Opus 是一套音频/语音编解码器。当它对波形文件进行编码时,它将原始 *.WAV 文件分解为多个编码数据包,并最终将它们组合成一个 *.opus 文件,封装多个不同大小的数据包,我需要知道封装数据包的确切大小在 *.opus 文件中。这是特定于 IETF 定义的标准,来源可从:opus-codec.org
猜你喜欢
  • 2021-02-05
  • 2017-12-22
  • 1970-01-01
  • 1970-01-01
  • 2017-10-13
  • 2021-03-26
  • 1970-01-01
  • 1970-01-01
  • 2012-01-28
相关资源
最近更新 更多