Spaces:
Running
Running
File size: 477 Bytes
f2bee8a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
export default class MockAudioBufferPlayer {
constructor (samples, sampleRate) {
this.samples = samples;
this.sampleRate = sampleRate;
this.buffer = {
getChannelData: jest.fn(() => samples),
sampleRate: sampleRate
};
this.play = jest.fn((trimStart, trimEnd, onUpdate) => {
this.onUpdate = onUpdate;
});
this.stop = jest.fn();
MockAudioBufferPlayer.instance = this;
}
}
|