Permalink
Browse files

Merge pull request #3 from cventers/sln

Add support for signed linear files with several rates
  • Loading branch information...
2 parents 4866f81 + 74783de commit 8266463f837ea2a159b4cd2bfb19395eed2b1005 @datacompboy committed Mar 28, 2012
Showing with 6 additions and 2 deletions.
  1. +4 −0 Player.hx
  2. +2 −2 fmt/FileSln.hx
  3. BIN wavplayer-debug.swf
  4. BIN wavplayer.swf
View
@@ -53,6 +53,7 @@ class Player extends flash.events.EventDispatcher {
// To-do: re-play already loaded stream
pitch = new Array<Float>();
trace("Player for "+fname);
+ var slnrx = ~/[.](sln(\d{1,3}))$/i;
if ((~/[.]au$/i).match(fname)) {
Sound = new fmt.FileAu();
} else
@@ -62,6 +63,9 @@ class Player extends flash.events.EventDispatcher {
if ((~/[.](sln|raw)$/i).match(fname)) {
Sound = new fmt.FileSln();
} else
+ if (slnrx.match(fname)) {
+ Sound = new fmt.FileSln(Std.parseInt(slnrx.matched(2)) * 1000);
+ } else
if ((~/[.](alaw|al)$/i).match(fname)) {
Sound = new fmt.FileAlaw();
} else
View
@@ -17,9 +17,9 @@ package fmt;
// FileRaw: stream raw file reader. Subclass it to define used sound decoder
class FileSln extends fmt.FileRaw {
- public function new() {
+ public function new(?srate : Int = 8000) {
super();
- rate = 8000;
+ rate = srate;
channels = 1;
chunkSize = 2;
align = 0;
View
Binary file not shown.
View
Binary file not shown.

0 comments on commit 8266463

Please sign in to comment.