diff --git a/README.md b/README.md index d0c227c..de107f2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -**audioread** - информация о wav-файлах +**wave-info** - информация о wav-файлах ##Лицензия - Copyright (C) 2011-2013, Maxim Lihachev, + Copyright (C) 2011-2019, Maxim Lihachev, This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ значения отсчётов, уровень сигнала в формате dB и LUFS, значение фазы ##Использование - audioread [OPTIONS] + wave-info [OPTIONS] Common flags: -i --info=samples,phase,db,lufs Type of information diff --git a/audioread.hs b/wave-info.hs similarity index 93% rename from audioread.hs rename to wave-info.hs index a499bf8..7a1121b 100644 --- a/audioread.hs +++ b/wave-info.hs @@ -1,9 +1,6 @@ {-# LANGUAGE DeriveDataTypeable, RecordWildCards #-} --- Создан: Ср 28 сен 2016 10:18:53 --- Изменен: Чт 10 ноя 2016 18:00:29 - --- Copyright (C) 2011-2013, Maxim Lihachev, +-- Copyright (C) 2011-2019, Maxim Lihachev, -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -62,8 +59,8 @@ notZero x = not (isNaN x || x == 0) -- ============================================================================= -- Чтение данных аудиофайла -audioread :: WAVE -> [[Double]] -audioread = map samplesToDouble . waveSamples +waveinfo :: WAVE -> [[Double]] +waveinfo = map samplesToDouble . waveSamples where samplesToDouble (l:r:[]) = [sampleToDouble l, sampleToDouble r] --Выбор канала из пары @@ -126,7 +123,7 @@ calcPhase samples -- ============================================================================= -- Параметры -data Audioread = Audioread { +data WaveInfo = WaveInfo { info :: String, samples :: Int, channel :: String, @@ -136,15 +133,15 @@ data Audioread = Audioread { } deriving (Show, Data,Typeable) -- Стандартные значения и описания параметров -defaultOptions :: IO Audioread -defaultOptions = cmdArgs $ Audioread { +defaultOptions :: IO WaveInfo +defaultOptions = cmdArgs $ WaveInfo { file = "none" &= typ "FILE.WAV" &= help "File for analysis", info = "none" &= typ "samples,phase,db,lufs" &= help "Type of information", samples = 1200 &= typ "12000" &= help "Number of samples for analysis", channel = "L" &= typ "L/R" &= help "Channel from stereo stream", title = 0 &= typ "1/0" &= help "File for analysis", vu = "db" &= typ "db/lufs" &= help "Type of vu scale" - } &= summary "audioread v0.3: information about audiofiles" + } &= summary "wave-info v0.3: information about audiofiles" -- Вывод строки с префиксом и суффиксом describe :: (Show s) => Int -> String -> s -> String -> IO () @@ -163,7 +160,7 @@ main = do exitFailure d <- getWAVEFile $ file cmd - let w = samples cmd ## audioread d + let w = samples cmd ## waveinfo d let exec fx = do describe (title cmd) ("\n---[ " ++ fx) "" (" ]:")