PageRenderTime 243ms CodeModel.GetById 121ms app.highlight 1ms RepoModel.GetById 120ms app.codeStats 0ms

/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
 7package com.ryanberdeen.audio {
 8  import flash.utils.ByteArray;
 9
10  /**
11  * An abstraction over the <code>Sound.extract()</code> method.
12  */
13  public interface ISampleSource {
14    function extract(target:ByteArray, length:Number, startPosition:Number = -1):Number;
15
16    /**
17    * Converts a linear sample offset to a source sample offset.
18    */
19    function toSourcePosition(position:Number):Number;
20
21    /**
22    * The number of samples in the source.
23    */
24    function get length():Number;
25  }
26}