mmsyn7ukr 0.2.0.0 → 0.2.1.0
raw patch · 4 files changed
+43/−10 lines, 4 filesdep ~basedep ~mmsyn2dep ~mmsyn3PVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, mmsyn2, mmsyn3, mmsyn6ukr
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- Processing_mmsyn7ukr.hs +36/−5
- SoXBasics.hs +0/−2
- mmsyn7ukr.cabal +3/−3
ChangeLog.md view
@@ -20,3 +20,7 @@ * Second version. Fixed an issue with the copying files. Changed a module structure. Some minor changes to the documentation. +## 0.2.1.0 -- 2019-12-24++* Second version revised A. Extended the bounds for the base package dependency so that it now can be compiled for GHC 8.8.1. +Added some functionality to improve the control over the program mmsyn7ukr behaviour.
Processing_mmsyn7ukr.hs view
@@ -12,6 +12,7 @@ module Processing_mmsyn7ukr where +import Numeric import System.Directory import Control.Exception (bracketOnError, onException) import EndOfExe (showE)@@ -35,14 +36,27 @@ "S.wav", "T.wav", "U.wav", "V.wav", "W.wav", "X.wav", "Y.wav", "Z.wav", "a.wav", "b.wav", "c.wav", "d.wav", "e.wav", "f.wav"] $ ["а", "б", "в", "г", "д", "дж", "дз", "е", "ж", "з", "и", "й", "к", "л", "м", "н", "о", "п", "р", "с", "сь", "т", "у", "ф", "х", "ц", "ць", "ч", "ш", "ь", "і", "ґ"]) $ file1- putStr "The needed files were not created, because the sound was not at the moment of recording! The process will be restarted "+ putStr "The needed files were NOT created, because the sound was not at the moment of recording! The process will be restarted " putStrLn "for the sound. Please, produce a sound during the first 3 seconds (after 0.5 second delay) or specify greater ratio!" playA file+ putStrLn "The sound duration is:"+ duration0 <- durationA file+ putStrLn $ showFFloat Nothing duration0 $ show 0+ putStrLn ""+ putStrLn "It means that to produce more than 3 seconds of recording, you must specify at least "+ putStrLn $ " " ++ show (3.0/(7*duration0)) ++ " as a next step ratio being prompt "+ putStrLn " OR "+ putStrLn $ " " ++ show (1.0/(7*duration0)) ++ " per one second but not less than the previous number."+ putStrLn $ "For example for 10 seconds record, please, specify " ++ show (10.0/(7*duration0)) ++ " as a next step ratio." longerK0 <- tempS soundUkr (_, Just hout, _, _) <- createProcess (proc (fromJust . showE $ "soxi") ["-D", file]) { std_out = CreatePipe } x3 <- hGetContents hout let longerK = (read x3::Double)*longerK0- putStrLn $ "Please, now pronounce the sound representation of the " ++ soundUkr ++ " sound or whatever you would like to be substituted (be sensible, please)! "+ putStrLn "Please, wait for 0.5 second and pronounce the sound representation for the "+ putStrLn ""+ putStrLn $ " \"" ++ (if soundUkr /= "ь" then map toUpper soundUkr else soundUkr) ++ "\""+ putStrLn ""+ putStrLn " sound or whatever you would like to be substituted instead (be sensible, please)! " if (compare (7*longerK) 3.0 == LT) then recA "x.wav" (7*longerK) else recA "x.wav" 3.0@@ -70,15 +84,28 @@ beginProcessing :: FilePath -> FilePath -> String -> IO () beginProcessing file file1 soundUkr = do cleanTemp- putStr "The needed files were not created, because the sound was not at the moment of recording! The process will be restarted "+ putStr "The needed files were NOT created, because the sound was not at the moment of recording! The process will be restarted " putStrLn "for the sound. Please, produce a sound during the first 3 seconds (after 0.5 second delay) or specify greater ratio!" putStrLn $ "Listen to the \"" ++ soundUkr ++ "\" sound and note first of all its duration. " playA file+ putStrLn "The sound duration is:"+ duration0 <- durationA file+ putStrLn $ showFFloat Nothing duration0 $ show 0+ putStrLn ""+ putStrLn "It means that to produce more than 3 seconds of recording, you must specify at least "+ putStrLn $ " " ++ show (3.0/(7*duration0)) ++ " as a next step ratio being prompt "+ putStrLn " OR "+ putStrLn $ " " ++ show (1.0/(7*duration0)) ++ " per one second but not less than the previous number."+ putStrLn $ "For example for 10 seconds record, please, specify " ++ show (10.0/(7*duration0)) ++ " as a next step ratio." longerK0 <- tempS soundUkr (_, Just hout, _, _) <- createProcess (proc (fromJust . showE $ "soxi") ["-D", file]) { std_out = CreatePipe } x3 <- hGetContents hout let longerK = (read x3::Double)*longerK0- putStrLn $ "Please, now pronounce the sound representation of the " ++ soundUkr ++ " sound or whatever you would like to be substituted (be sensible, please)! "+ putStrLn "Please, wait for 0.5 second and pronounce the sound representation for the "+ putStrLn ""+ putStrLn $ " \"" ++ (if soundUkr /= "ь" then map toUpper soundUkr else soundUkr) ++ "\""+ putStrLn ""+ putStrLn " sound or whatever you would like to be substituted instead (be sensible, please)! " if (compare (7*longerK) 3.0 == LT) then recA "x.wav" (7*longerK) else recA "x.wav" 3.0@@ -104,7 +131,11 @@ -- | Function to get the @Double@ value, which shows in how many times you expect that your sound representation will be longer than the one provided by the @mmsyn6ukr@ package. tempS :: String -> IO Double tempS soundUkr = onException (do - putStrLn $ "In how many times do you think your sound representing " ++ soundUkr ++ " will sound longer than the recently played one? Specify as a Double value without \"e\" notation. "+ putStrLn "In how many times do you think your sound representing " + putStrLn ""+ putStrLn $ " \"" ++ (if soundUkr /= "ь" then map toUpper soundUkr else soundUkr) ++ "\"" + putStrLn ""+ putStrLn "will sound longer than the recently played one? Specify as a Double value without \"e\" notation. " longivityY <- getLine let long = read longivityY::Double in return long) (do putStrLn "Please, specify the value of the Double type!"
SoXBasics.hs view
@@ -57,7 +57,6 @@ -- Bool @True@ corresponds to maximum value, @False@ - to minimum value. selMA :: FilePath -> (Int, Int) -> Bool -> IO String selMA file (lowerbnd, upperbnd) x = if x then getMaxA file (lowerbnd, upperbnd) else getMinA file (lowerbnd, upperbnd)-{-# INLINE selMA #-} -- | Function 'extremeS' returns an approximate sample number of the extremum, which will be used further for fade effect. extremeS :: FilePath -> (Int, Int) -> Int -> IO (String, Bool) -> IO Int@@ -70,7 +69,6 @@ if (ys == rs) then extremeS file (lowerbnd, t) eps x else extremeS file (t, upperbnd) eps x-{-# INLINE extremeS #-} -- | Function 'alterVadB' removes an approximate silence measured by the absolute value of the sound amplitude from the beginning of the file. -- The function must be used with the @FilePath@ parameter containing no directories in its name (that mean the file of the @FilePath@ parameter must be
mmsyn7ukr.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: mmsyn7ukr-version: 0.2.0.0+version: 0.2.1.0 synopsis: A simple basic interface to some SoX functionality or to produce a close to the proper Ukrainian speech (if you pronounce sounds properly) with your own recorded voice. description: A program and a library that can be used as a simple basic interface to some SoX functionality or to produce a close to the proper Ukrainian speech (if you pronounce sounds properly) with your own recorded voice. homepage: https://hackage.haskell.org/package/mmsyn7ukr@@ -20,7 +20,7 @@ exposed-modules: UkrainianLControl, SoXBasics, Processing_mmsyn7ukr, Main -- other-modules: -- other-extensions:- build-depends: base >=4.7 && <4.13, process >=1.4 && <1.8, vector >=0.11 && <0.14, mmsyn2 >=0.1.6.1 && <1, directory >=1.2.5 && <1.4, mmsyn6ukr >=0.6 && <1, mmsyn3 >=0.1.3 && <1+ build-depends: base >=4.7 && <4.14, process >=1.4 && <1.8, vector >=0.11 && <0.14, mmsyn2 >=0.1.7 && <1, directory >=1.2.5 && <1.4, mmsyn6ukr >=0.6.1 && <1, mmsyn3 >=0.1.4 && <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.13, process >=1.4 && <1.8, vector >=0.11 && <0.14, mmsyn2 >=0.1.6.1 && <1, directory >=1.2.5 && <1.4, mmsyn6ukr >=0.6 && <1, mmsyn3 >=0.1.3 && <1+ build-depends: base >=4.7 && <4.14, process >=1.4 && <1.8, vector >=0.11 && <0.14, mmsyn2 >=0.1.7 && <1, directory >=1.2.5 && <1.4, mmsyn6ukr >=0.6.1 && <1, mmsyn3 >=0.1.4 && <1 -- hs-source-dirs: default-language: Haskell2010