# US 2021/0287696 A1 · Method and apparatus for matching audio clips, computer-readable medium, and electronic device

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0287696 A1
- Document ID: US20210287696A1
- Status: Published application
- Kind: A1
- Application number: 17/336,562
- Filed: 2021-06-02
- Published: 2021-09-16
- Earliest claimed: 2019-05-24
- Assignees: Tencent Technology (Shenzhen) Company Limited
- Applicants: Tencent Technology (Shenzhen) Company Limited
- Inventors: Fang Chao LIN; Wei Biao Yun; Peng ZENG
- Web page: https://patentgrep.com/patent/US20210287696A1

## CPC

- G10L 25/51: for comparison or discrimination
- G10L 25/54: for retrieval
- G10L 25/27: characterised by the analysis technique
- Y02D 30/70: in wireless communication networks
- G10L: SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

A method for matching audio clips includes: obtaining a first feature sequence corresponding to a first audio clip and a second feature sequence corresponding to a second audio clip; constructing a distance matrix, elements in the distance matrix representing respective distances between first positions in the first feature sequence and second positions in the second feature sequence; calculating a first accumulation distance between a start position and a target position in the distance matrix, and calculating a second accumulation distance between an end position and the target position in the distance matrix; and calculating a minimum distance between the first feature sequence and the second feature sequence based on the first accumulation distance and the second accumulation distance, and determining a degree of matching between the first audio clip and the second audio clip according to the minimum distance.

## Claims

### Claim 1

A method for matching audio clips, performed by a computer device, the method comprising:
obtaining a first feature sequence corresponding to a first audio clip and a second feature sequence corresponding to a second audio clip;
constructing a distance matrix between the first feature sequence and the second feature sequence, elements in the distance matrix representing respective distances between first positions in the first feature sequence and second positions in the second feature sequence;
determining a first accumulation distance between a start position and a target position in the distance matrix and a second accumulation distance between an end position and the target position in the distance matrix;
determining a minimum distance between the first feature sequence and the second feature sequence based on the first accumulation distance and the second accumulation distance; and
determining a degree of matching between the first audio clip and the second audio clip according to the minimum distance.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the determining the first accumulation distance comprises:
determining accumulation distances between the start position and first candidate positions, the first candidate positions being located between the start position and the target position in the distance matrix;
determining first candidate accumulation distances between the start position and the target position, each of the first candidate accumulation distances being based on an accumulation distance between the start position and a corresponding first candidate position and a distance value represented by the corresponding first candidate position in the distance matrix; and
determining, as the first accumulation distance, a minimum value among the first candidate accumulation distances.

### Claim 3 (depends on 2)

The method according to claim 2, wherein the determining the first candidate accumulation distances comprises, with respect to each of the first candidate positions:
adding the accumulation distance between the start position and the corresponding first candidate position and the distance value represented by the corresponding first candidate position to obtain a distance sum value of the corresponding first candidate position, the accumulation distance of the corresponding first candidate position being based on distances between the start position and previous positions of the corresponding first candidate position, the previous positions being located between the start position and the corresponding first candidate position in the distance matrix; and
determining the distance sum value as a first candidate accumulation distance of the corresponding first candidate position.

### Claim 4 (depends on 2)

The method according to claim 2, wherein the determining the first candidate accumulation distances comprises, with respect to each of the first candidate positions:
performing a weighted calculation on the distance value represented by the corresponding first candidate position by using a weight value of the corresponding first candidate position, to obtain a weighted distance value of the corresponding first candidate position;
adding the accumulation distance between the start position and the corresponding first candidate position and the weighted distance value of the corresponding first candidate position to obtain a distance sum value of the corresponding first candidate position, the accumulation distance of the corresponding first candidate position being based on distances between the start position and previous positions of the corresponding first candidate position, the previous positions being located between the start position and the corresponding first candidate position in the distance matrix; and
determining the distance sum value as a first candidate accumulation distance of the corresponding first candidate position.

### Claim 5 (depends on 4)

The method according to claim 4, further comprising, prior to the determining the distance sum value as the first candidate accumulation distance of the corresponding first candidate position:
determining a distance between the corresponding first candidate position and a diagonal of the distance matrix, the diagonal being a straight line connecting the start position and the end position; and
determining the weight value of the corresponding first candidate position according to the distance between the corresponding first candidate position and the diagonal.

### Claim 6 (depends on 2)

The method according to claim 2, wherein
the first candidate positions are located within a preset distance range around the target position.

### Claim 7 (depends on 1)

The method according to claim 1, wherein the calculating the second accumulation distance comprises:
determining accumulation distances between the end position and second candidate positions, the second candidate positions being located between the target position and the end position in the distance matrix;
determining second candidate accumulation distances between the end position and the target position, each of the first candidate accumulation distances being based on an accumulation distance between the end position and a corresponding second candidate position and a distance value represented by the corresponding second candidate position in the distance matrix; and
determining, as the second accumulation distance, a minimum value among the second candidate accumulation distances.

### Claim 8 (depends on 7)

The method according to claim 7, wherein
the second candidate positions are located within a preset distance range around the target position.

### Claim 9 (depends on 1)

The method according to claim 1, wherein the determining the minimum distance comprises:
adding a distance value represented by the target position in the distance matrix, the first accumulation distance, and the second accumulation distance, to obtain the minimum distance.

### Claim 10 (depends on 1)

The method according to claim 1, wherein the determining the minimum distance comprises:
adding a weighted distance value represented by the target position in the distance matrix, the first accumulation distance, and the second accumulation distance, to obtain the minimum distance.

### Claim 11 (depends on 1)

The method according to claim 1, wherein the first audio clip corresponds to n first feature sequences, and the second audio clip corresponds to n second feature sequences, n being a positive integer; and
the determining the degree of matching comprises:
obtaining n minimum distances between the n first feature sequences and the n second feature sequences;
performing a weighted summation on the n minimum distances to obtain a weighted distance value between the first audio clip and the second audio clip; and
determining the degree of matching between the first audio clip and the second audio clip according to the weighted distance value.

### Claim 12

An apparatus for matching audio clips, comprising:
at least one memory configured to store program code; and
at least one processor configured to read the program code and operate as instructed by the program code, the program code comprising:
obtaining code configured to cause the at least one processor to obtain a first feature sequence corresponding to a first audio clip and a second feature sequence corresponding to a second audio clip;
construction code configured to cause the at least one processor to: construct a distance matrix between the first feature sequence and the second feature sequence, elements in the distance matrix representing respective distances between first positions in the first feature sequence and second positions in the second feature sequence; and
processing code configured to cause the at least one processor to: determine a first accumulation distance between a start position and a target position in the distance matrix and a second accumulation distance between an end position and the target position in the distance matrix; determine a minimum distance between the first feature sequence and the second feature sequence based on the first accumulation distance and the second accumulation distance;
and determine a degree of matching between the first audio clip and the second audio clip according to the minimum distance.

### Claim 13 (depends on 12)

The apparatus according to claim 12, wherein the processing code comprises:
first determining code configured to cause the at least one processor to determine accumulation distances between the start position and first candidate positions, the first candidate positions being located between the start position and the target position in the distance matrix;
second determining code configured to cause the at least one processor to determine first candidate accumulation distances between the start position and the target position, each of the first candidate accumulation distances being based on an accumulation distance between the start position and a corresponding first candidate position and a distance value represented by the corresponding first candidate position in the distance matrix; and
third determining code configured to cause the at least one processor to determine, as the first accumulation distance, a minimum value among the first candidate accumulation distances.

### Claim 14 (depends on 13)

The apparatus according to claim 13, wherein the second determining code is further configured to cause the at least one processor to, with respect to each of the first candidate positions:
add the accumulation distance between the start position and the corresponding first candidate position and the distance value represented by the corresponding first candidate position, to obtain a distance sum value of the corresponding first candidate position, the accumulation distance of the corresponding first candidate position being based on distances between the start position and previous positions of the corresponding first candidate position, the previous positions being located between the start position and the corresponding first candidate position in the distance matrix; and
determine the distance sum value as a first candidate accumulation distance of the corresponding first candidate position.

### Claim 15 (depends on 13)

The apparatus according to claim 13, wherein the second determining code is further configured to cause the at least one processor to, with respect to each of the first candidate positions:
perform a weighted calculation on the distance value represented by the corresponding first candidate position and a weight value of the corresponding first candidate position, to obtain a weighted distance value of the corresponding first candidate position;
add the accumulation distance between the start position and the corresponding first candidate position and the weighted distance value of the corresponding first candidate position to obtain a distance sum value of the corresponding first candidate position, the accumulation distance of the corresponding first candidate position being based on distances between the start position and previous positions of the corresponding first candidate position, the previous positions being located between the start position and the corresponding first candidate position in the distance matrix; and
determine the distance sum value as a first candidate accumulation distance of the corresponding first candidate position.

### Claim 16 (depends on 15)

The apparatus according to claim 15, wherein the second determining code is further configured to cause the at least one processor to, prior to the determining the distance sum value as the first candidate accumulation distance of the corresponding first candidate position:
determine a distance between the corresponding first candidate position and a diagonal of the distance matrix, the diagonal being a straight line connecting the start position and the end position; and
determine the weight value of the corresponding first candidate position according to the distance between the corresponding first candidate position and the diagonal.

### Claim 17 (depends on 13)

The apparatus according to claim 13, wherein
the first candidate positions are located within a preset distance range around the target position.

### Claim 18 (depends on 12)

The apparatus according to claim 12, wherein the processing code further comprises:
fourth determining code configured to cause the at least one processor to determine accumulation distances between the end position and second candidate positions, the second candidate positions being located between the target position and the end position in the distance matrix;
fifth determining code configured to cause the at least one processor to determine second candidate accumulation distances between the end position and the target position, each of the first candidate accumulation distances being based on an accumulation distance between the end position and a corresponding second candidate position and a distance value represented by the corresponding second candidate position in the distance matrix; and
sixth determining code configured to cause the at least one processor to determine, as the second accumulation distance, a minimum value among the second candidate accumulation distances.

### Claim 19

Anon-transitory computer-readable medium, storing a computer program, the computer program being executable by at least one processor to perform:
obtaining a first feature sequence corresponding to a first audio clip and a second feature sequence corresponding to a second audio clip;
constructing a distance matrix between the first feature sequence and the second feature sequence, elements in the distance matrix representing respective distances between first positions in the first feature sequence and second positions in the second feature sequence;
determining a first accumulation distance between a start position and a target position in the distance matrix and a second accumulation distance between an end position and the target position in the distance matrix;
determining a minimum distance between the first feature sequence and the second feature sequence based on the first accumulation distance and the second accumulation distance; and
determining a degree of matching between the first audio clip and the second audio clip according to the minimum distance.

### Claim 20 (depends on 1)

An electronic device, comprising:
one or more processors; and
a storage apparatus, configured to store one or more programs, the one or more programs being executable by the one or more processors to perform the method according to claim 1.
