audio-effects.js 736 B

123456789101112131415161718192021222324
  1. export default class MockAudioEffects {
  2. static get effectTypes () { // @todo can this be imported from the real file?
  3. return {
  4. ROBOT: 'robot',
  5. REVERSE: 'reverse',
  6. LOUDER: 'higher',
  7. SOFTER: 'lower',
  8. FASTER: 'faster',
  9. SLOWER: 'slower',
  10. ECHO: 'echo'
  11. };
  12. }
  13. constructor (buffer, name) {
  14. this.buffer = buffer;
  15. this.name = name;
  16. this.process = jest.fn(done => {
  17. this._finishProcessing = renderedBuffer => {
  18. done(renderedBuffer, 0, 1);
  19. return new Promise(resolve => setTimeout(resolve));
  20. };
  21. });
  22. MockAudioEffects.instance = this;
  23. }
  24. }