Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Compression in audio: reduce sampling rate, bit depth, and number of channels

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > IT Information >

Share

Shulou(Shulou.com)11/24 Report--

Before we start, I have a question for you: why compress a file? At a loss, you decided to download something regardless of this problem for the time being. After opening the "net to suppress the Cloud", you found several favorite songs in the daily recommendation, and you felt that you had met true love. so immediately click to download to want to take these songs for yourself. In the download options, you find that there are the highest sound quality, very high sound quality, and general sound quality options. You think you must take care of your ears when you listen to music, so you choose the highest sound quality. As a result, "net suppresses Cloud" calls you to rush to the member, so you get angry. Chose extremely high sound quality.

Looking back on the question just now, do you suddenly think that the extremely high sound quality is some compression of the highest sound quality? Because the file size of the extremely high sound quality is smaller than the highest sound quality. The answer is, of course, yes. Although the extremely high sound quality is not as good as the nice from the highest sound quality, smaller files take up less disk space and facilitate data transmission, so compression technology is very important for audio. Of course, compression technology can also induce people to krypton gold.

It's too far. Now let's take a look at the idea of compression in audio. First, let's take a look at the formula for file size:

File size (file size) = duration (duration) * sampling rate (sampling rate) * bit depth (bit depth) * number of channels (number of channels)

Since the duration of an audio cannot be changed, we can only start with reducing the sampling rate / bit depth / the number of channels.

Let's first take a look at the sampling rate (sampling rate). The higher the sampling rate, the better the quality of a piece of audio. The commonly used sampling rate is shown in the figure:

You can see that the lowest sampling rate is 11025Hz, which is used for voice and amplitude modulation (AM) broadcasting. As you can see, the sampling rate of FM radio is twice as high as that of amplitude modulation (AM), which is why we usually choose FM xxx instead of AM xxx when listening to radio on private cars, because FM has better sound quality. If you are interested, you can listen to the two broadcasts next time on the bus and compare them.

Another idea of audio compression is to reduce the bit depth (bit-depth). The commonly used bit depth is 8-bit and 16-bit. If a 16-bit audio file with a size of 10MB is compressed to 8-bit, the file size can be reduced by about 5MB. Generally speaking, the bit depth of ordinary speech (which does not require too much sound quality) is 8 bits, while for music with higher sound quality, the bit depth is usually 16 bits. after all, no one wants to listen to songs full of noise.

So what is the number of channels? Generally speaking, stereo (stereophonic audio) is a method of sound reproduction (sound reproduction). Generally speaking, there are at least two audio channels, which can cause "I hear sounds coming from both directions!" The feeling makes the audio three-dimensional and closer to the natural audio. For a stereo with two audio channels, only one channel is reduced, and the size of the audio file is halved. However, this operation can cause damage to sound, so it is only suitable for short sound effects or voice, not for music.

In addition, audio files are not suitable for lossless compression because continuous audio samples with the same value are not common. The commonly used audio compression method is lossy compression, such as mp3. But mp3 provides a good compression ratio while maintaining audio quality.

Author: time

Audit: White smoke

This article comes from the official account of Wechat: APC Science Alliance (ID:apcscience), author: APC Jun

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

IT Information

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report