Wave file sampling rate conversion

xiaoxiao2021-03-06  47

Wave format audio file sampling rate conversion

First, this conversion method is a file conversion method, and a new audio file is generated on the basis of the current file analysis.

Second, the method takes more time, but the speed is within the allowable range

Third, the analysis document is in one byte operation when writing new files

4. The new file generated by this method is only 16 bits. If other precision is required, it is necessary to perform precision conversion.

Operating procedures:

First, the head structure of the source file, the sampling rate, the number of channels, data length, and data traffic of the source file is obtained.

2. According to the file head structure, the head structure of the new file is generated, and each parameter is determined, where the sampling rate is specified by the user.

Third, determine the number of cycles of the conversion based on the sampling rate of the source file and the number of channels.

Fourth, acquire and transform the voice data of the source file, the conversion formula:

(((ITMP << 8) ITMP) -32768) << 16

Among them, ITMP is a double-byte data acquired.

5. Transfer the converted data to the file you need to write, and turn again, the formula is as follows:

1, c = ((((C 0x800000)

转载请注明原文地址:https://www.9cbs.com/read-77475.html

New Post(0)