FileRaw.hx 1.1 KB

123456789101112131415161718192021222324252627
  1. //
  2. // WAV/AU Flash player with resampler
  3. //
  4. // Copyright (c) 2009, Anton Fedorov <datacompboy@call2ru.com>
  5. //
  6. /* This code is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License version 2 only, as
  8. * published by the Free Software Foundation.
  9. *
  10. * This code is distributed in the hope that it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  13. * version 2 for more details (a copy is included in the LICENSE file that
  14. * accompanied this code).
  15. */
  16. package fmt;
  17. // FileRaw: stream raw file reader. Subclass it to define used sound decoder
  18. class FileRaw extends fmt.File {
  19. // Returns is stream ready to operate: header readed (1), not ready (0), error(-1)
  20. public override function ready(): Int {
  21. // For raw file, not defined channels/chunkSize/rate or decoder is error
  22. if (channels == 0 || chunkSize == 0 || rate == 0 || sndDecoder==null) return -1;
  23. return 1;
  24. }
  25. }