Comparison and implementation of MP3, WAV


Free Download Mp4Gain
picture

Comparison and implementation of MP3, WAV

WAV vs MP3
WAV vs MP3

Sound has three elements: pitch, volume, and timbre:

WAV vs MP3
WAV vs MP3

Pitch is determined by the frequency of the sound wave, the higher the frequency, the higher the pitch.
The volume is determined by the amplitude of the sound wave, the larger the amplitude, the louder the sound.
The timbre is determined by the “shape” of the waveform (sounds like square, triangle, and sawtooth are called impulse waves and sound individual).
An audio file is a file obtained by converting an analog signal to a digital signal. In general, there are 5 important parameters: encoding method, number of channels, sampling rate, bit depth, and bit rate.

Encoding: how this format organizes binary data and how it is compressed.
Number of channels: mono, dual or 5.1 channels, etc.
Sampling rate: The number of samples per second.
Bit Depth: The number of binary bits used to store the y value of the sample point.
Bitrate – The desired number of bits per second for the file.
We know that there is no compression in the WAV format, so its encoding method is to directly write all the sampled points to the file in order.

WAV file size (B) = number of channels * sample rate (Hz) * bit depth (bit) / 8 + the file header size (B, it’s 44B)

Implementation
When you open an mp3 or wav file with a text editor, you see numbers like this:
4944 3303 0000 0000 3d48 5459 4552 0000
0006 0000 0032 3031 3800 5444 4154 0000
0006 0000 0032 3230 3300 5449 4d45 0000
0006 0000 0031 3430 3600 5052 4956 0000
168e 0000 584d 5000 3c3f 7870 6163 6b65
7420 6265 6769 6e3d 22ef bbbf 2220 6964
3d22 5735 4D30 4D70 4365 6869 487A 7265
537A 4E54 637A 6B63 3964 223F 3E0A 3A78
6D70 6D65 7461 2078 6D6C 6E78 3D22
6F62 653A 6574 612F
5249 4646 2e3d 0e05 5741 5645 666d 7420
1200 0000 0300 0200 44ac 0000 2062 0500
0800 2000 0000 6461 7461 a026 0e05 8089
00bc 00e8 f0bb c09e 8dbc 00c2 87bc 80f1
d3bc 8063 ccbc c030 fcbc 8012 f4bc 20bb
13bd e051 0fbd c0b0 2dbd 6079 28bd 4012
46bd 6032 40bd c0e3 5dbd 6040 57bd c015
7cbd e035 74bd b058 8dbd 50e2 88bd f0a7 9dbd e0dd 98bd 70d3 acbd e0a9 a7bd
d043 b8bd b0da b2bd
00e3 c4bd 605c bfbd
This one above is the mp3/wav format of the same song. What is the difference between them?

WAV
structure
file header
The WAV format follows the RIFF Resource Interchange File Format, so the WAV format is actually a three-layer relationship, which is simplified here. Its file header format is as follows:

Address Carving type content
00H-03H 4 character * 4 RIFF resource file exchange flag
04H-07H 4 unsigned int The number of bytes from the next address to the end of the file.
08H-0BH 4 character * 4 WAV file WAVE logo
0CH-0FH 4 character * 4 fmt wave file flag, the last digit is 0x20 space
10H-13H 4 unsigned int The size of the subchunk file header. For the WAV subfragment, the value is 0x10.
14H-15H 2 short unsigned Format type, when the value is 1, it means the data is linear PCM encoding
16H-17H 2 short unsigned number of channels
18H-1BH 4 int unsigned Sampling rate
1CH-1FH 4 int unsigned Wave file bytes per second = sample rate Bit depth PCM / 8 channels
20H-21H 2 short unsigned DATA data block unit length = number of channels * PCM bit depth / 8
22H-23H 2 short unsigned Bit depth PCM
24H-27H 4 character * 4 data stamp data
28H-2BH 4 unsigned int Total length of data part (bytes)
struct WAVHeader
{ char RIFF[ 4 ]; ///Resource file exchange flag RIFF unsigned LEN; ///Number of bytes from the next address to the end of the file char WAV[ 4 ]; ///WAV file flag WAVE char FMT [ 4 ]; ///Wave fmt file pointer, last digit is 0x20 space unsigned SubchunkSize; ///The size of the sub-chunk file header, for WAV this sub-chunk, the value is 0x10 DATATYPE short unsigned; / //Format type, when the value is 1, it means the data is unsigned linear PCM encoding short CH ; ///Number of unsigned channels F; ///Unsigned sample rate BYTERATE; ///Number of bytes per second of wave file = sample rate*PCM bit depth/8*Number of unsigned channels

short DATAUNITLEN; ///DATA block unit length=channel number*PCM bit depth/unsigned 8 short BITDEPTH; ///PCM bit depth character DATA[ 4 ]; ///Unsigned data mark data DATALEN ; ///Total data section length (bytes) };


Free Download Mp4Gain
picture


Mp4Gain Main Window
picture


Mp4Gain Features
picture


Free Download Mp4Gain
picture

Comparison and implementation of MP3, WAV

Comparison and implementation of MP3, WAV

WAV vs. MP3
WAV vs. MP3

An mp3 is 320kbps, 44100hz, what does this mean?

WAV vs. MP3
WAV vs. MP3

44100Hz represents the sample rate of the signal. The so-called sampling consists of obtaining the value y of the sound wave at the current moment every unit of time. Sampling is the process of discretizing continuous data (converting an analog signal to a digital signal).
image source

The sampling method mentioned above is called PCM (Pulse Code Modulation). According to the Nyquist-Shannon sampling law, the sampling rate must be at least twice the highest target frequency. The hearing range of the human ear is about 20Hz-20,000Hz (if you’re curious how loud you can hear, you can click here to test your ears), although recording software often has a 48,000 option Hz, but we can safely conclude: 44100Hz can meet almost all our needs, higher is just a waste of your memory and CPU. More than 48,000 samples are meaningless to the human ear, which is similar to 24 frames per second on a movie. 44100Hz happens to be the standard sample rate for almost all music released. In fact, for vocals and many instruments, high-frequency sounds are noise, so high sample rates can sometimes worsen sound quality (which is why we need to adjust the equalizer).

320kbps represents your bit rate/bit rate, which is short for kilobits per second, which represents the size of the data used to describe sound. In CD (uncompressed audio file), the bit rate is 1411.2 kbps, and the mp3 sound quality to achieve CD quality should be higher than 128 kbps / 44100 Hz (128 kbps can be said to be the most common bit rate). Generally, a higher number means better quality. The quality depends on many factors (such as the encoding algorithm). Many times we don’t need too high bitrate: our device can play mp3 and CD without difference (sound/sound card is normal).

A wav is 44100 Hz 16-bit stereo or 22050 Hz 8-bit mono, what does this mean? stereo/mono refers to dual/mono. For monophonic sound files, the sample data is an eight-bit short integer (short int 00H-FFH); for two-channel stereo sound files, each sample data is a 16-bit integer (int) and the upper eight bits (left channel) and lower eight bits (right channel) represent the two channels, respectively.

Sound is a mechanical wave, produced by the vibration of an object, and requires a medium to propagate. So, in essence, a sound is a waveform on an axis over time.

MP3 or WAV: who offers more advantages

MP3 or WAV: who offers more advantages

MP3 and WAV are two of the most popular audio formats in the world. Even if for many the only difference lies in the size of the files, there is much more that distinguishes these two formats. For example, there are differences in the display accuracy of many spectral components and many other things that are explained in more detail below. Then you will know exactly where the differences are between WAV and MP3 and what is the optimal application area for the respective format.

WAV vs. MP3

Everyone has to find out for themselves which format offers them the most advantages and which special application area is really important to them. For example, if you only listen to music on your cell phone or in the car, MP3 may be what you need as it takes up little space and is therefore particularly practical. If you work with music a lot, and especially create music yourself, WAV may be more suitable for you, as it brings some additional aspects to processing.

Mp3 vs Wav

The differences between the two formats:

-An MP3 file reaches the quality of a normal CD at about 128 kbit / s. However, with a WAV file, around 1400 kbit / s are required.
-In theory, WAV can have up to 65535 channels of audio, while an MP3 surround can only have six.
-WAV files are usually uncompressed PCM files.
-MP3, on the other hand, is a codec. Therefore, it is the result of compression, which, however, does not normally lead to a noticeable loss of quality.

A WAV file is suitable here:

When producing music. WAV should always be the first choice here, because with WAV files you can make any specific frequency range higher. In the case of MP3 files, on the other hand, it may happen that the desired frequency range is encoded precisely and therefore no longer reflects the natural dynamics of the original signal. This quickly creates noise that does not exist with WAV files.
Also, WAV is much more flexible as you can save the files with a variety of channels. For example, an optimal 7.1 music performance can only be created thanks to WAV.
You should also always prefer WAV for analytical measurements, as MP3 can produce noises that were only created later by the encoder.
If you are bothered by the “large” storage space that is lost due to WAV files, you can convert these files even further. In the FLAC format, WAV files are also reduced by up to 60%.

For this, you should prefer MP3:

With no audible loss of quality, MP3 files can be extremely compressed without most people hearing them. You can save up to 90% storage space without having to accept a noticeable loss of quality! You can also save huge music collections on your mobile devices without any hassle.
In addition, MP3 is now so widespread that there is practically no device that does not support this format. All DVD and BluRay players, smartphones, consoles or car radios should be able to play your MP3 files without any problem. So you never have to worry about whether you can play your favorite songs with it before buying a new device.
If any of the formats particularly convince you, you can convert your files very easily and, above all, free to the format you want. If, for example, the facts you just read inspire you for the MP3 format, you can convert your WAV files to MP3 quickly and easily. There are numerous free and understandable programs for this, with which you can convert as a loan in a few minutes.