packages feed

mmsyn6ukr 0.8.2.0 → 0.8.3.0

raw patch · 3 files changed

+26/−23 lines, 3 filesdep ~mmsyn2dep ~mmsyn5PVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: mmsyn2, mmsyn5

API changes (from Hackage documentation)

- Main: main :: IO ()

Files

ChangeLog.md view
@@ -160,6 +160,10 @@  ## 0.8.2.0 -- 2020-10-28 -* Eigth version revised B. Fixed issues with some combinations that were not +* Eighth version revised B. Fixed issues with some combinations that were not  properly handled.++## 0.8.3.0 -- 2020-10-29++* Eighth version revised C. Changed the dependencies boundaries. Some minor code improvements. 
Melodics/Executable.hs view
@@ -4,8 +4,8 @@ -- License     :  MIT -- Maintainer  :  olexandr543@yahoo.com ----- A program and a library that can be used as a musical instrument synthesizer or for Ukrainian speech synthesis --- especially for poets, translators and writers. +-- A program and a library that can be used as a musical instrument synthesizer or for Ukrainian speech synthesis+-- especially for poets, translators and writers. --  module Melodics.Executable (@@ -18,42 +18,41 @@ where  import Data.Char (isSpace, isControl)-import Data.Maybe (isJust,fromJust,fromMaybe)+import Data.Maybe (isJust,fromJust) import System.IO-import System.IO.Unsafe (unsafePerformIO) import System.Process (callProcess)-import System.Directory (removeFile,findExecutable)+import System.Directory (removeFile) import Control.Exception (onException) import EndOfExe (showE) import Melodics.Ukrainian (appendS16LEFile, convertToProperUkrainian) import UkrainianLControl --- | Is used to repeat the cycle of creation of the sound files in the current directory for the @mmsyn6ukr@  executable. +-- | Is used to repeat the cycle of creation of the sound files in the current directory for the @mmsyn6ukr@  executable. circle :: String -> IO () circle zs = onException (mapM_ (workWithInput zs) [1..]) (do     putStr "Notice, there was (may be) CmdLineArgument exception. To avoid it, please, specify the command line argument (if needed) in the form \"ABC\""     putStr " where A is either a letter \'f\', \'o\', \'w\' or a digit and B and C are both digits! The exception (may be) arose from "-    putStrLn $ "the command line arguments " ++ show zs ++ ". Please, check also whether the SoX was installed with the support for needed codec.") +    putStrLn $ "the command line arguments " ++ show zs ++ ". Please, check also whether the SoX was installed with the support for needed codec.")  -- | Interactively creates sound files in the current directory for the Ukrainian text input. Is used internally in the 'circle' workWithInput :: String -> Int -> IO ()-workWithInput zs j = do+workWithInput zs _ = do   [nameSF,ys] <- nameAndControl zs [1,2]   withBinaryFile (nameSF ++ ".raw") AppendMode (appendS16LEFile (convertToProperUkrainian ys))   putStrLn "The .raw file was created by the program. If there is SoX installed then it will run further. "-  let ts = showE "sox" +  let ts = showE "sox"   if isJust ts     then rawToSoundFile zs nameSF (fromJust ts)     else printInfoF  -- | Is used to retriev the user-defined file name for the record. recFileName :: IO String-recFileName = do +recFileName = do   putStrLn "Please, specify the name of the resulting sound file. Please, do NOT use '}' character and space or control characters!"   nameOfSoundFile <- getLine   let nameSF = filter (\x -> not (isSpace x) && not (isControl x) && x /= '}') nameOfSoundFile   return nameSF-  + getCtrl :: String -> IO String getCtrl zs = do   xs <- getLine@@ -62,28 +61,28 @@  recFNAndCtrl :: String -> Int -> IO String recFNAndCtrl zs n-  | odd n = recFileName +  | odd n = recFileName   | otherwise = getCtrl zs  nameAndControl :: String -> [Int] -> IO [String] nameAndControl zs = mapM (recFNAndCtrl zs) --- | Converts RAW sound to the sound file of the needed format in the current directory accordingly to the 'genControl' for the first 'String' argument. +-- | Converts RAW sound to the sound file of the needed format in the current directory accordingly to the 'genControl' for the first 'String' argument. -- Is used internally in the 'workWithInput'. rawToSoundFile :: String -> String -> FilePath -> IO ()-rawToSoundFile zs nameSF executablePath -  | null zs = do +rawToSoundFile zs nameSF executablePath+  | null zs = do      callProcess executablePath ["-r22050","-c1","-L","-esigned-integer","-b16", nameSF ++ ".raw", nameSF ++ ".wav"]      removeFile $ nameSF ++ ".raw"   | otherwise = do      let ws = snd . genControl $ zs-     callProcess executablePath ["-r22050","-c1","-L","-esigned-integer","-b16", nameSF ++ ".raw", fst ws, nameSF ++ snd ws] +     callProcess executablePath ["-r22050","-c1","-L","-esigned-integer","-b16", nameSF ++ ".raw", fst ws, nameSF ++ snd ws]      removeFile $ nameSF ++ ".raw"  -- | Prints informational message about ending of the possible for the given data program operation on sound files. Is used internally in the 'workWithInput'. -- Is used internally in the 'workWithInput'. printInfoF :: IO ()-printInfoF = do +printInfoF = do   putStr "You have a resulting file in a raw PCM format with bitrate 22050 Hz and 1 channel (mono) in the .raw format. "   putStr "You can further process it by yourself manually, otherwise, please, install FFMpeg or LibAV executables in the directory mentioned in the variable PATH"   putStrLn " and then run: "
mmsyn6ukr.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                mmsyn6ukr-version:             0.8.2.0+version:             0.8.3.0 synopsis:            A musical instrument synthesizer or a tool for Ukrainian language listening description:         A program can be used as a musical instrument synthesizer or for Ukrainian speech synthesis especially for poets and writers homepage:            https://hackage.haskell.org/package/mmsyn6ukr@@ -18,10 +18,10 @@ cabal-version:       >=1.10  library-  exposed-modules:     Paths_mmsyn6ukr, Main, Melodics.Ukrainian, Melodics.Executable, UkrainianLControl, MMSyn6Ukr.Show7s-  -- other-modules:    +  exposed-modules:     Paths_mmsyn6ukr, Melodics.Ukrainian, Melodics.Executable, UkrainianLControl, MMSyn6Ukr.Show7s+  other-modules:       Main   -- other-extensions:-  build-depends:       base >=4.7 && <4.15, process >=1.4 && <1.9, mmsyn3 >=0.1.5.0 && <1, directory >= 1 && < 1.5, vector >=0.11 && <0.14, bytestring >=0.10 && <0.13, mmsyn2 >=0.1.8 && <1, mmsyn5 >=0.4.4 && <1+  build-depends:       base >=4.7 && <4.15, process >=1.4 && <1.9, mmsyn3 >=0.1.5.0 && <1, directory >= 1 && < 1.5, vector >=0.11 && <0.14, bytestring >=0.10 && <0.13, mmsyn2 >=0.3 && <1, mmsyn5 >=0.5 && <1   -- hs-source-dirs:   default-language:    Haskell2010 @@ -29,6 +29,6 @@   main-is:             Main.hs   other-modules:       Melodics.Executable, Melodics.Ukrainian, Paths_mmsyn6ukr, UkrainianLControl, MMSyn6Ukr.Show7s   -- other-extensions:-  build-depends:       base >=4.7 && <4.15, process >=1.4 && <1.9, mmsyn3 >=0.1.5.0 && <1, directory >= 1 && < 1.5, vector >=0.11 && <0.14, bytestring >=0.10 && <0.13, mmsyn2 >=0.1.8 && <1, mmsyn5 >=0.4.4 && <1+  build-depends:       base >=4.7 && <4.15, process >=1.4 && <1.9, mmsyn3 >=0.1.5.0 && <1, directory >= 1 && < 1.5, vector >=0.11 && <0.14, bytestring >=0.10 && <0.13, mmsyn2 >=0.3 && <1, mmsyn5 >=0.5 && <1   -- hs-source-dirs:   default-language:    Haskell2010