Improve visible waveform for voice messages
This tries to prioritize actual voice to decide the waveform, and clamps noise to zero to ensure the waveform doesn't have a perceptually noisy base. In theory this better matches the overall voice message content.
This commit is contained in:
parent
e38d27f64e
commit
df7b598ca7
3 changed files with 27 additions and 14 deletions
|
@ -75,7 +75,8 @@ export function arraySmoothingResample(input: number[], points: number): number[
|
|||
for (let i = 1; i < input.length - 1; i += 2) {
|
||||
const prevPoint = input[i - 1];
|
||||
const nextPoint = input[i + 1];
|
||||
const average = (prevPoint + nextPoint) / 2;
|
||||
const currPoint = input[i];
|
||||
const average = (prevPoint + nextPoint + currPoint) / 3;
|
||||
samples.push(average);
|
||||
}
|
||||
input = samples;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue