Browse Source

Подготовка к релизу

master
Maxim Lihachev 8 years ago
parent
commit
f1a5025a4f
  1. 3
      .gitignore
  2. 0
      audioread.hs
  3. 31
      wave.hs

3
.gitignore vendored

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
*.o
*.hi
*.wav

0
level.hs → audioread.hs

31
wave.hs

@ -1,31 +0,0 @@ @@ -1,31 +0,0 @@
-- Создан: Ср 28 сен 2016 10:18:53
-- Изменен: Чт 29 сен 2016 11:18:07
import System.Environment
import Data.WAVE
-- import Data.List
--Выбор канала из пары
chL :: [a] -> a
chL pair = pair!!0
chR :: [a] -> a
chR pair = pair!!1
audioread :: String -> String -> [Char] -> IO ()
audioread samples file ch = do
w <- getWAVEFile file
mapM_ print (map (sampleToDouble . channel) (take (read samples::Int) $ waveSamples w)) where
channel (xs)
| ch == ['R'] = chR xs
| ch == ['L'] = chL xs
| otherwise = chL xs
main :: IO ()
main = do
cmd <- getArgs
case cmd of
[samples, file, ch] -> audioread samples file ch
[samples, file] -> audioread samples file ['L']
_ -> putStrLn "Usage: audioread [samples] [file.wav] [L/R]"
Loading…
Cancel
Save