搜尋此網誌

顯示具有 程式 標籤的文章。 顯示所有文章
顯示具有 程式 標籤的文章。 顯示所有文章

2009年10月13日 星期二

暫存

最近在處理對聲音判斷其音量大小 目前有點卡關 暫存一些我查到的資訊
似乎是可以利用sample size 和number of channels 來決定此音源的音量大小

Digital audio is stored as a series of samples, where each sample is the amplitude of the sound wave being recorded. The volume of the sound is the same as the amplitude of the sound, therefore, each individual sample is simply encoded as the volume of the sound.

So you break the mic input down into a list of samples (based on the sample size / number of channels) and keep a running average to determine the sound level.