Time Representation in Audio and Video Programming

There are some way to represent time in the computer. With C language, the “time_t” type or “Epoch Time” came to me first. It is also called “Unix Time”.

The Epoch Time is a number of seconds from January 1, 1970, 00:00:00. It is easy to understand.

However, it is not suitable for the audio video programming.

In the audio video programming, a second is long time. For example, in the High Res Audio 96 KHz Sampling Data, there are 96000 samples are available in a second. The interval of each samples is 1 / 96000 = 0.000010416666667 second = About 0.01 ms.

To express it, use following form in the audio video programming:

Time Value (The index of a sample data) / Time Scale

For example, to express a second in 96 KHz audio use next form:

96000 / 96000

With this form, the number of datas can express a time. If you convert this to a floating value to understand, a deviation will be made. The precision of the data is different. In the audio video programming, we should not use floating seconds directly, use only to display string.

スポンサーリンク
最新情報をチェックしよう!

Audioの最新記事8件

>現役のプログラマーが書くプログラミング情報

現役のプログラマーが書くプログラミング情報

日々の開発の中での学びや分かったこと、調べたことなどを書いていくブログです。

CTR IMG