Skip to content

Commit

Permalink
chore: update jsdoc, fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
dlepaux committed Feb 6, 2024
1 parent 9577de8 commit dfbc1c1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
3 changes: 0 additions & 3 deletions src/realtime-bpm-analyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export class RealTimeBpmAnalyzer {
/**
* Remve all validPeaks between the minThreshold pass in param to optimize the weight of datas
* @param minThreshold Value between 0.9 and 0.2
* @returns An empty Promise
*/
async clearValidPeaks(minThreshold: Threshold): Promise<void> {
this.minValidThreshold = Number.parseFloat(minThreshold.toFixed(2));
Expand All @@ -106,7 +105,6 @@ export class RealTimeBpmAnalyzer {
* @param audioSampleRate Audio sample rate (44100)
* @param bufferSize Buffer size (4096)
* @param postMessage Function to post a message to the processor node
* @returns An empty Promise
*/
async analyzeChunck(channelData: Float32Array, audioSampleRate: number, bufferSize: number, postMessage: (message: PostMessageEvents) => void): Promise<void> {
if (this.options.debug) {
Expand Down Expand Up @@ -167,7 +165,6 @@ export class RealTimeBpmAnalyzer {
* @param currentMinIndex Current minimum index
* @param currentMaxIndex Current maximum index
* @param postMessage Function to post a message to the processor node
* @returns An empty Promise
*/
async findPeaks(channelData: Float32Array, bufferSize: number, currentMinIndex: number, currentMaxIndex: number, postMessage: (data: PostMessageEvents) => void): Promise<void> {
await descendingOverThresholds(async threshold => {
Expand Down
1 change: 0 additions & 1 deletion testing/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import type {Manifest} from './types';

/**
* Testing the lowpass filter from 50 Hz to 500 Hz
* @returns An empty Promise
*/
async function setup(): Promise<void> {
const allLogs: Record<number, {mae: number; rmse: number; accuracy: number}> = {};
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/analyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('Analyzer - Integration tests', () => {
const buffer = await response.arrayBuffer();
const audioBuffer = await audioContext.decodeAudioData(buffer);
const tempo = await analyzeFullBuffer(audioBuffer);
expect(tempo[0].tempo).to.be.equal(125);
expect(tempo[0].tempo).to.be.equal(124);
await audioContext.close();
});
});

0 comments on commit dfbc1c1

Please sign in to comment.