mmsyn7l 0.2.3.0 → 0.3.0.0
raw patch · 5 files changed
+47/−31 lines, 5 filesdep −directorydep ~mmsyn7ukrPVP ok
version bump matches the API change (PVP)
Dependencies removed: directory
Dependency ranges changed: mmsyn7ukr
API changes (from Hackage documentation)
Files
- CHANGELOG.md +2/−2
- MMSyn7l.hs +12/−17
- Main.hs +17/−3
- README +11/−4
- mmsyn7l.cabal +5/−5
CHANGELOG.md view
@@ -36,6 +36,6 @@ * Second version revised C. Fixed an issue with the wrong dependency mmsyn7ukr>=0.6.2.1. --+## 0.3.0.0 -- 2020-01-28 +* Third version. Changed the dependency bounds. Added the support for informational messages. Some documentation improvements.
MMSyn7l.hs view
@@ -3,6 +3,7 @@ -- Copyright : (c) OleksandrZhabenko 2020 -- License : MIT --+-- Stability : Experimental -- Maintainer : olexandr543@yahoo.com -- -- A program and a library to modify the amplitude of the sound representations for @@ -12,8 +13,8 @@ module MMSyn7l where import Data.Char (toUpper, isDigit)-import System.Directory-import SoXBasics+import qualified SoXBasics as SB+import qualified SoXBasics1 as SB1 import qualified Data.Vector as V import Control.Exception (onException) import CaseBi (getBFst')@@ -51,7 +52,7 @@ -- and so on. changeVolume :: FilePath -> IO () changeVolume file = do- playA file+ SB.playA file let sound = getBFst' ("е", V.fromList . zip ["A.wav", "B.wav", "C.wav", "D.wav", "E.wav", "F.wav", "G.wav", "H.wav", "I.wav", "J.wav", "K.wav", "L.wav", "M.wav", "N.wav", "O.wav", "P.wav", "Q.wav", "R.wav", "S.wav", "T.wav", "U.wav", "V.wav", "W.wav", "X.wav", "Y.wav", "Z.wav", "a.wav", "b.wav", "c.wav", @@ -100,8 +101,8 @@ specifyVol :: FilePath -> IO () specifyVol file = do change0 <- getLine- upperbound <- upperBnd file- (originalStr, bool) <- selMaxAbs file (0::Int, upperbound)+ upperbound <- SB.upperBnd file+ (originalStr, bool) <- SB.selMaxAbs file (0::Int, upperbound) if bool then changeVol3 file (change0, originalStr) else changeVol4 file (change0, originalStr)@@ -112,10 +113,8 @@ let ys = take 4 . filter isDigit $ xs coefA = 0.0001 * fromIntegral (read ys::Int) ratio = 1.0 - coefA- volS file (ratio * ampl)- removeFile file- renameFile ("8." ++ file) file-+ SB1.volS file (ratio * ampl)+ -- | Function 'changeVol3' is used internally in the 'specifyVol' in case of working with the maximum amplitude. changeVol3 :: FilePath -> (String, String) -> IO () changeVol3 file (change0, originalStr) = do@@ -130,10 +129,8 @@ let ys = take 4 . takeWhile (isDigit) $ xs coefA = 0.0001 * fromIntegral (read ys::Int) ratio = 1.0 + (delta / ampl) * coefA- volS file (ratio * ampl)- removeFile file- renameFile ("8." ++ file) file- else error "SoXBasics: the volS function gave a strange result!"+ SB1.volS file (ratio * ampl)+ else error "SoXBasics1: the volS function gave a strange result!" -- | Function 'changeVol4' is used internally in the 'specifyVol' in case of working with the minimum amplitude. changeVol4 :: FilePath -> (String, String) -> IO ()@@ -149,8 +146,6 @@ let ys = take 4 . filter isDigit $ xs coefA = 0.0001 * fromIntegral (read ys::Int) ratio = 1.0 + (delta / ampl) * coefA- volS file (ratio * ampl)- removeFile file- renameFile ("8." ++ file) file- else error "SoXBasic: the volS function gave a strange result!"+ SB1.volS file (ratio * ampl)+ else error "SoXBasics1: the volS function gave a strange result!"
Main.hs view
@@ -3,6 +3,7 @@ -- Copyright : (c) OleksandrZhabenko 2020 -- License : MIT --+-- Stability : Experimental -- Maintainer : olexandr543@yahoo.com -- -- A program and a library to modify the amplitudes of the sound representations for @@ -22,8 +23,8 @@ main :: IO () main = do args <- getArgs- if null args- then do+ case args of+ [] -> do putStrLn "Now you can change the amplitude of the sound representations of the Ukrainian sounds (or something similar). " putStrLn "" mapM_ changeVolume ["A.wav", "B.wav", "C.wav", "D.wav", "E.wav", "F.wav", "G.wav", "H.wav", @@ -33,7 +34,20 @@ putStrLn "" putStrLn "Now you have changed (or left unchanged) the amplitudes for the sound representations for Ukrainian language. " putStrLn "Please, remember about responsible usage especially in case of processing the real voice sound samples! "- else do+ ("-h":_) -> do+ putStrLn "SYNOPSYS: "+ putStrLn "mmsyn7l -h OR"+ putStrLn "mmsyn7l -v OR"+ putStrLn "mmsyn7l [list-of-needed-sounds-to-be-amplitude-modified]"+ putStrLn "\"-h\" prints this message."+ putStrLn "\"-v\" prints version number of the program."+ putStr "[list-of-needed-sounds-to-be-amplitude-modified (if given) -- the program modifies the amplitudes in the interactive mode only for the "+ putStrLn "given sound representations. If not specified, the program modifies the amplitudes for all non-pause Ukrainian sounds representations."+ putStrLn ""+ ("-v":_) -> do+ putStrLn "mmsyn7l version: 0.3.0.0"+ putStrLn ""+ _ -> do putStrLn "Now you can change the amplitude of the needed sound representations of the Ukrainian sounds (or something similar). " putStrLn "" let xs = take 1 $ args
README view
@@ -30,8 +30,15 @@ and so on. ***** Command Line Argument ***** -If you specify a command line argument, it must be a sorted list -of the Ukrainian sounds representations, which can be obtained by -using the mmsyn7s package. For more information, please, refer to:-https://hackage.haskell.org/package/mmsyn7s+If you specify a command line argument (other than "-h" or "-v"),+it must be a sorted list of the Ukrainian sounds representations,+which can be obtained by using the mmsyn7s package. For more information,+please, refer to: https://hackage.haskell.org/package/mmsyn7s+In such a case, the program will modify only the amplitudes for+those Ukrainian sounds representations, which are in the list.+Otherwise, the program will modify the amplitudes for all non-silent Ukrainian+sounds representations in the current directory.++The "-h" command line argument is used for the help informational message.+The "-v" command line argument is used for the version number.
mmsyn7l.cabal view
@@ -2,9 +2,9 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: mmsyn7l-version: 0.2.3.0-synopsis: Modifies the amplitude of the sound representations for the Ukrainian language created by mmsyn7ukr package.-description: A program and a library to modify the amplitude of the sound representations for the Ukrainian language created by mmsyn7ukr package or somehow otherwise.+version: 0.3.0.0+synopsis: Modifies the amplitudes of the Ukrainian sounds representations created by mmsyn7ukr package.+description: A program and a library to modify the amplitudes of the Ukrainian sounds representations created by mmsyn7ukr package or somehow otherwise. homepage: https://hackage.haskell.org/package/mmsyn7l license: MIT license-file: LICENSE@@ -20,7 +20,7 @@ exposed-modules: Main, MMSyn7l -- other-modules: -- other-extensions:- build-depends: base >=4.7 && <4.14, directory >=1 && <1.5, mmsyn7ukr >=0.6.3 && <1, vector >=0.11 && <0.14, mmsyn2 >=0.1.7 && <1+ build-depends: base >=4.7 && <4.14, mmsyn7ukr >=0.10 && <1, vector >=0.11 && <0.14, mmsyn2 >=0.1.7 && <1 -- hs-source-dirs: default-language: Haskell2010 @@ -28,6 +28,6 @@ main-is: Main.hs -- other-modules: -- other-extensions:- build-depends: base >=4.7 && <4.14, directory >=1 && <1.5, mmsyn7ukr >=0.6.3 && <1, vector >=0.11 && <0.14, mmsyn2 >=0.1.7 && <1+ build-depends: base >=4.7 && <4.14, mmsyn7ukr >=0.10 && <1, vector >=0.11 && <0.14, mmsyn2 >=0.1.7 && <1 -- hs-source-dirs: default-language: Haskell2010