【问题标题】:Creating a mulaw audio file from L16从 L16 创建 mulaw 音频文件
【发布时间】:2019-04-02 12:30:49
【问题描述】:

我有一个包含这些属性的波形文件。

   sampling rate = 16000 Hz 
   encoding = L16 
   channels = 1 
   bit resolution = 16

我想做2个管道

1) 我将此文件内容作为 RTP 数据包扔到 port=5000 上

2) 监听 port=500 捕获 rtp 数据包并制作音频文件 以下属性

   sampling rate = 8000 Hz 
   encoding = PCMU 
   channels = 1 
   bit resolution = 8

我尝试过的是: 发件人:

gst-launch-1.0 filesrc location=/path/to/test_l16.wav ! wavparse ! audioconvert ! audioresample ! mulawenc ! rtppcmupay ! udpsink host=192.168.xxx.xxx port=5000

接收者:

gst-launch-1.0 udpsrc port=5000 ! "application/x-rtp,media=(string)audio, clock-rate=(int)8000, encoding-name=(string)PCMU, channels=(int)1" ! rtppcmudepay ! mulawdec ! filesink location=/path/to/test_pcmu.ulaw

但是我在 Test.ulaw 而不是 PCMU 获得 L16 文件

有什么建议吗?

【问题讨论】:

    标签: audio gstreamer pipeline mu-law


    【解决方案1】:

    检查mulawdec 元素的作用:

    Pad Templates:
      SINK template: 'sink'
        Availability: Always
        Capabilities:
          audio/x-mulaw
                       rate: [ 8000, 192000 ]
                   channels: [ 1, 2 ]
    
      SRC template: 'src'
        Availability: Always
        Capabilities:
          audio/x-raw
                     format: S16LE
                     layout: interleaved
                       rate: [ 8000, 192000 ]
                   channels: [ 1, 2 ]
    

    所以基本上它将 Mu Law 解码为 PCM。如果您想保存原始的 Mu Law,请删除 mulawdec 元素。

    【讨论】:

    • 嘿,谢谢。它通过删除mulawdec 起作用。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-04
    • 1970-01-01
    • 2017-07-06
    • 2020-05-17
    相关资源
    最近更新 更多