mmsyn7ukr-array 0.1.2.0 → 0.2.0.0
raw patch · 7 files changed
+12/−110 lines, 7 filesdep +mmsyn7ukr-commonPVP ok
version bump matches the API change (PVP)
Dependencies added: mmsyn7ukr-common
API changes (from Hackage documentation)
- Control.Exception.FinalException.Arr: DataFileNotClosed :: String -> FinalException
- Control.Exception.FinalException.Arr: DataSoundFileNotRead :: String -> FinalException
- Control.Exception.FinalException.Arr: ExecutableNotProperlyInstalled :: FinalException
- Control.Exception.FinalException.Arr: InitialFileNotChanged :: String -> FinalException
- Control.Exception.FinalException.Arr: MaybePartiallyTrimmed :: FinalException
- Control.Exception.FinalException.Arr: NoiseProfileNotCreatedB :: String -> FinalException
- Control.Exception.FinalException.Arr: NoiseProfileNotCreatedE :: String -> FinalException
- Control.Exception.FinalException.Arr: NotCreated :: String -> FinalException
- Control.Exception.FinalException.Arr: NotCreatedWithEffect :: String -> FinalException
- Control.Exception.FinalException.Arr: NotCreatedWithEffects :: String -> FinalException
- Control.Exception.FinalException.Arr: NotEnoughData :: String -> FinalException
- Control.Exception.FinalException.Arr: NotFileNameGiven :: FinalException
- Control.Exception.FinalException.Arr: NotRecorded :: String -> FinalException
- Control.Exception.FinalException.Arr: StrangeAnswer :: String -> String -> FinalException
- Control.Exception.FinalException.Arr: UndefinedFunction :: String -> FinalException
- Control.Exception.FinalException.Arr: catchEnd :: FinalException -> IO ()
- Control.Exception.FinalException.Arr: data FinalException
- Control.Exception.FinalException.Arr: instance GHC.Exception.Type.Exception Control.Exception.FinalException.Arr.FinalException
- Control.Exception.FinalException.Arr: instance GHC.Show.Show Control.Exception.FinalException.Arr.FinalException
- ReplaceP.Arr: replaceP :: String -> String
- ReplaceP.Arr: replaceP4 :: String -> String
Files
- ChangeLog.md +3/−0
- Control/Exception/FinalException/Arr.hs +0/−65
- Processing_mmsyn7ukr_array.hs +4/−3
- ReplaceP/Arr.hs +0/−37
- SoXBasics/Arr.hs +1/−1
- SoXBasics1/Arr.hs +1/−1
- mmsyn7ukr-array.cabal +3/−3
ChangeLog.md view
@@ -13,4 +13,7 @@ * First version revised B. Added the module Paths_mmys7ukr_array to use with "y.wav" sound. +## 0.2.0.0 -- 2022-08-16++* Second version. Added mmsyn7ukr-common as a dependency. Removed the duplicated modules.
− Control/Exception/FinalException/Arr.hs
@@ -1,65 +0,0 @@--- |--- Module : Control.Exception.FinalException.Arr--- Copyright : (c) OleksandrZhabenko 2020-2022--- License : MIT--- Stability : Experimental--- Maintainer : olexandr543@yahoo.com------ A program and a library that can be used as a simple --- basic interface to some SoX functionality or for producing --- the approximately Ukrainian speech with your own recorded --- voice (actually it produces the needed sound representations).-----{-# LANGUAGE DeriveDataTypeable #-}--module Control.Exception.FinalException.Arr (- FinalException(..)- -- * Exception- , catchEnd-) where--import Data.Typeable-import Control.Exception (Exception, catch, throw)-import System.Environment (getProgName)-import System.IO-import GHC.IO.Handle.Types (Newline( CRLF ), nativeNewline)---- | Data type 'FinalException' is used to terminate the not needed further execution.-data FinalException = ExecutableNotProperlyInstalled | MaybePartiallyTrimmed | NotCreatedWithEffect String- | InitialFileNotChanged String | NotCreated String | NotRecorded String | NoiseProfileNotCreatedB String | NoiseProfileNotCreatedE String- | NotEnoughData String | NotCreatedWithEffects String | StrangeAnswer String String | NotFileNameGiven | DataFileNotClosed String- | DataSoundFileNotRead String | UndefinedFunction String- deriving ( Typeable )--instance Exception FinalException--instance Show FinalException where- show ExecutableNotProperlyInstalled = "ExecutableNotProperlyInstalled: SoX is not properly installed in your system. Please, install it properly and then call the function again." ++ (if nativeNewline == CRLF then "\r\n" else "\n")- show MaybePartiallyTrimmed = "MaybePartiallyTrimmed: The function did not create the needed file, but may be it trimmed the initial one (not enough)!"- ++ (if nativeNewline == CRLF then "\r\n" else "\n")- show (NotCreatedWithEffect xs) = "NotCreatedWithEffect: File was not created with " ++ show xs ++ " effect!" ++ (if nativeNewline == CRLF then "\r\n" else "\n")- show (InitialFileNotChanged xs) = "InitialFileNotChanged: The initial file " ++ show xs ++ " was not changed!" ++ (if nativeNewline == CRLF then "\r\n" else "\n")- show (NotCreated xs) = "NotCreated: The function did not create the needed file " ++ show xs ++ "!" ++ (if nativeNewline == CRLF then "\r\n" else "\n")- show (NotRecorded xs) = "NotRecorded: The file " ++ show xs ++ " was not recorded!" ++ (if nativeNewline == CRLF then "\r\n" else "\n")- show (NoiseProfileNotCreatedB xs) = "NoiseProfileNotCreatedB: The noise profile " ++ xs ++ ".b.prof was not created!"- ++ (if nativeNewline == CRLF then "\r\n" else "\n")- show (NoiseProfileNotCreatedE xs) = "NoiseProfileNotCreatedE: The noise profile " ++ xs ++ ".e.prof was not created!"- ++ (if nativeNewline == CRLF then "\r\n" else "\n")- show (NotEnoughData xs) = "NotEnoughData: SoX cannot determine the number of the samples in the file " ++ show xs ++- "! May be it is a RAW file and it needs additional parameters to be processed." ++ (if nativeNewline == CRLF then "\r\n" else "\n")- show (NotCreatedWithEffects xs) = "NotCreatedWithEffects: File was not created with " ++ (init . unwords . map ((++ ",") . show) . words $ xs) ++ " effects!"- ++ (if nativeNewline == CRLF then "\r\n" else "\n")- show (StrangeAnswer xs ys) = xs ++ ": the " ++ show ys ++ " function gave a strange result!" ++ (if nativeNewline == CRLF then "\r\n" else "\n")- show NotFileNameGiven = "Please, specify as a command line argument at least a name of the resulting file (without its extension)! "- ++ (if nativeNewline == CRLF then "\r\n" else "\n")- show (DataFileNotClosed xs) = "File " ++ show xs ++ " is not closed!" ++ (if nativeNewline == CRLF then "\r\n" else "\n")- show (DataSoundFileNotRead xs) = "Data sound file " ++ show xs ++ " is not read!" ++ (if nativeNewline == CRLF then "\r\n" else "\n")- show (UndefinedFunction xs) = xs ++ ": the function is undefined for the arguments. " ++ (if nativeNewline == CRLF then "\r\n" else "\n")---- | Function to work with exception 'FinalException' similarly to the example in the documentation for the 'catch' function. It throws an exception--- to the thread where it is called. -catchEnd :: FinalException -> IO ()-catchEnd e = do- progName <- getProgName- catch (throw e) (\e0 -> hPutStr stderr (progName ++ ": " ++ show (e0 :: FinalException)))
Processing_mmsyn7ukr_array.hs view
@@ -44,11 +44,12 @@ import System.Info (os) import System.Environment (getProgName) import System.Exit-import SoXBasics.Arr+import Sound.SoXBasics import CaseBi.Arr (getBFst') import GHC.Arr-import ReplaceP.Arr (replaceP, replaceP4)-import Control.Exception.FinalException.Arr+import Parser.ReplaceP (replaceP, replaceP4)+import Sound.Control.Exception.FinalException+import SoXBasics.Arr (recA,recB,playA) -- | Function 'produceSound3' is used internally in the 'produceSound2' function. produceSound3 :: (String, String) -> (FilePath, FilePath) -> String -> (Int, Float) -> Float -> IO ()
− ReplaceP/Arr.hs
@@ -1,37 +0,0 @@--- |--- Module : ReplaceP.Arr--- Copyright : (c) OleksandrZhabenko 2020-2022--- License : MIT--- Stability : Experimental--- Maintainer : olexandr543@yahoo.com------ A program and a library that can be used as a simple --- basic interface to some SoX functionality or for producing --- the approximately Ukrainian speech with your own recorded --- voice (actually it produces the needed sound representations).-----module ReplaceP.Arr where---- | Function is used internally to parse a given third command line argument as a @[String]@ representing the Ukrainian sounds, which will be produced.-replaceP :: String -> String-replaceP (x:y:z:u:v:xs) | x == '[' && y == '\"' && z == '[' && u == '\\' && v == '\\' = "[\"\\" ++ replaceP xs- | x == ',' && y == '\\' && z == '\\' = "\",\"\\" ++ replaceP (u:v:xs)- | x == ']' && y == '\"' && z == ']' = "\"]" ++ replaceP (u:v:xs)- | otherwise = x:replaceP (y:z:u:v:xs)-replaceP (x:y:z:u:xs) | x == ',' && y == '\\' && z == '\\' = "\",\"\\" ++ replaceP (u:xs)- | x == ']' && y == '\"' && z == ']' = "\"]" ++ replaceP (u:xs)- | otherwise = x:replaceP (y:z:u:xs)-replaceP (x:y:z:xs) | x == ',' && y == '\\' && z == '\\' = "\",\"\\" ++ replaceP xs- | x == ']' && y == '\"' && z == ']' = "\"]" ++ replaceP xs- | otherwise = x:replaceP (y:z:xs)-replaceP xs = xs---- | Function is used internally to parse further the result dealt with 'replaceP' function.-replaceP4 :: String -> String-replaceP4 (t:x:y:z:u:v:xs) | [t,x,y,z,u,v] == "\\\\1078" = '\1078':replaceP4 xs- | [t,x,y,z,u,v] == "\\\\1079" = '\1079':replaceP4 xs- | [t,x,y,z,u,v] == "\\\\1100" = '\1100':replaceP4 xs- | otherwise = t:replaceP4 (x:y:z:u:v:xs)-replaceP4 (x:xs) = x:replaceP4 xs-replaceP4 [] = []
SoXBasics/Arr.hs view
@@ -70,7 +70,7 @@ import Control.Concurrent (threadDelay) import Control.Exception (onException) import System.Info (os)-import Control.Exception.FinalException.Arr+import Sound.Control.Exception.FinalException -- | Function 'maxAbs' allows to choose a maximum by absolute value if the values are written as @String@. Bool @True@ corresponds to maximum value, @False@ - to minimum value maxAbs :: (String, String) -> (String, Bool)
SoXBasics1/Arr.hs view
@@ -45,7 +45,7 @@ import EndOfExe import System.Exit import qualified SoXBasics.Arr as SB (extremeS1,upperBnd,selMA,maxAbs,norm)-import Control.Exception.FinalException.Arr+import Sound.Control.Exception.FinalException -- | Function 'norm' applies a SoX normalization effect on the audio file. -- The function must be used with the @FilePath@ parameter containing no directories in its name (that means the file of the @FilePath@ parameter must be
mmsyn7ukr-array.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: mmsyn7ukr-array-version: 0.1.2.0+version: 0.2.0.0 synopsis: A simple reduced basic interface to some SoX functionality or to produce a voice that can be used by mmsyn7h-array, dobutokO2-array and other similar packages description: A reduced set of modules and functionality needed to dobutokO2-array package and probably some other ones. Is rewritten from the mmsyn7ukr-0.17.0.0 package to reduce the needed dependencies. homepage: https://hackage.haskell.org/package/mmsyn7ukr-array@@ -18,10 +18,10 @@ cabal-version: >=1.10 library- exposed-modules: SoXBasics.Arr, SoXBasics1.Arr, Processing_mmsyn7ukr_array, ReplaceP.Arr, Control.Exception.FinalException.Arr, Paths_mmsyn7ukr_array+ exposed-modules: SoXBasics.Arr, SoXBasics1.Arr, Processing_mmsyn7ukr_array, Paths_mmsyn7ukr_array -- other-modules: -- other-extensions:- build-depends: base >=4.7 && <5, process >=1.4 && <2, mmsyn2-array ==0.3.0.0, directory >=1.2.5 && <2, mmsyn3 ==0.1.6.0+ build-depends: base >=4.7 && <5, process >=1.4 && <2, mmsyn2-array ==0.3.0.0, directory >=1.2.5 && <2, mmsyn3 ==0.1.6.0, mmsyn7ukr-common ==0.2.0.0 -- hs-source-dirs: default-language: Haskell2010