/flash/flash-audio/src/com/ryanberdeen/audio/ISampleSource.as

http://echo-nest-remix.googlecode.com/ · ActionScript · 26 lines · 8 code · 4 blank · 14 comment · 0 complexity · 5cfba65908a57f103fa7689bfdf2856d MD5 · raw file

  1. /*
  2. * Copyright 2009 Ryan Berdeen. All rights reserved.
  3. * Distributed under the terms of the MIT License.
  4. * See accompanying file LICENSE.txt
  5. */
  6. package com.ryanberdeen.audio {
  7. import flash.utils.ByteArray;
  8. /**
  9. * An abstraction over the <code>Sound.extract()</code> method.
  10. */
  11. public interface ISampleSource {
  12. function extract(target:ByteArray, length:Number, startPosition:Number = -1):Number;
  13. /**
  14. * Converts a linear sample offset to a source sample offset.
  15. */
  16. function toSourcePosition(position:Number):Number;
  17. /**
  18. * The number of samples in the source.
  19. */
  20. function get length():Number;
  21. }
  22. }