iOS音頻開發之`AudioStreamBasicDescription`,ios音視頻開發

來源:互聯網
上載者:User

iOS音頻開發之`AudioStreamBasicDescription`,ios音視頻開發

這個類提供了對於音頻檔案的描述

 
  • An audio stream is a continuous series of data that represents a sound, such as a song.

  • A channel is a discrete track of monophonic audio. A monophonic stream has one channel; a stereo stream has two channels.

  • A sample is single numerical value for a single audio channel in an audio stream.

  • A frame is a collection of time-coincident samples. For instance, a linear PCM stereo sound file has two samples per frame, one for the left channel and one for the right channel.

  • A packet is a collection of one or more contiguous frames. A packet defines the smallest meaningful set of frames for a given audio data format, and is the smallest data unit for which time can be measured. In linear PCM audio, a packet holds a single frame. In compressed formats, it typically holds more; in some formats, the number of frames per packet varies.

  • The sample rate for a stream is the number of frames per second of uncompressed (or, for compressed formats, the equivalent in decompressed) audio.

首先,音頻檔案的產生是類比訊號->PCM以後的數字訊號->壓縮、編碼以後的音頻檔案。
PCM時採樣頻率叫做sample rate。
每一次採樣可以得到若干採樣資料,對應多個channel。
每一個採樣點得到的若干採樣資料群組合起來,叫做一個frame。
若干frame組合起來叫做一個packet。
mSampleRate,就是採用頻率
mBitsPerChannel,就是每個採樣資料的位元
mChannelsPerFrame,可以理解為聲道數,也就是一個採樣時刻產生幾個採樣資料。
mFramesPerPacket,就是每個packet的中frame的個數,等於這個packet中經曆了幾次採樣間隔。
mBytesPerPacket,每個packet中資料的位元組數。
mBytesPerFrame,每個frame中資料的位元組數

計算公式

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.