packages feed

mmsyn7ukr 0.6.3.0 → 0.7.0.0

raw patch · 4 files changed

+50/−20 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

- Processing_mmsyn7ukr: tempS :: String -> IO Double
+ Processing_mmsyn7ukr: tempS :: String -> IO (Double, Bool)

Files

ChangeLog.md view
@@ -85,3 +85,8 @@  * Sixth version revised E. Simplified the parsing module ReplaceP. +## 0.7.0.0 -- 2020-01-20++* Sevenh version. Added the possibility to omit the securing and regularizative usual limitation for the initial sound data recording duration.+It is so called 'sharp' mode. Fixed an issue with the wrong duration. Some minor code improvements.+
Processing_mmsyn7ukr.hs view
@@ -53,9 +53,9 @@ ; putStrLn "The sound duration is: " ; produceSound2 (file, file1) (actsctrl, noiseLim) soundUkr ; return () }) (do-       putStrLn "Something went unexpectedly, please, repeat the precedure agein, be attentive to the data you provide as input! "+       putStrLn "Something went unexpectedly, please, repeat the precedure again, be attentive to the data you provide as input! "        putStr "The needed files were NOT created (may be 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 "for the sound. Please, produce a sound during the first 3 seconds (after 0.5 second delay) or specify greater ratio or use \'sharp\' mode!"        cleanTemp        produceSound (actsctrl, noiseLim) file) @@ -128,16 +128,18 @@     ; 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+    ; (longerK0,sharp) <- tempS soundUkr     ; let longerK = (read x3::Double)*longerK0     ; 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+    ; if sharp+        then recA "x.wav" (7*longerK)+        else if (compare (7*longerK) 3.0 == GT)+               then recA "x.wav" (7*longerK)+               else recA "x.wav" 3.0     ; putStrLn "The file is recorded and now will be automatically processed. You will be notificated with the text message in the terminal about the creation of the needed file. Please, wait a little. "     ; norm "x.wav"     ; noiseProfB "8x.wav"@@ -190,16 +192,18 @@ ; putStrLn $ "For example for 10 seconds record, please, specify " ++ show (10.0/(7*duration0)) ++ " as a next step ratio." ; (_, Just hout, _, _) <- createProcess (proc (fromJust . showE $ "soxi") ["-D", file]) { std_out = CreatePipe } ; x3 <- hGetContents hout-; longerK0 <- tempS soundUkr+; (longerK0,sharp) <- tempS soundUkr ; let longerK = (read x3::Double)*longerK0 ; 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+; if sharp+        then recA "x.wav" (7*longerK)+        else if (compare (7*longerK) 3.0 == GT)+               then recA "x.wav" (7*longerK)+               else recA "x.wav" 3.0 ; putStrLn "The file is recorded and now will be automatically processed. You will be notificated with the text message in the terminal about the creation of the needed file. Please, wait a little. " ; norm "x.wav" ; noiseProfB "8x.wav"@@ -209,7 +213,7 @@ ; putStrLn "If you specified as a first command line argument the following the program behaves: " ; putStrLn "0 -> after the noise reduction the program only resample the audio to the needed 22050 Hz and adjusts the amlitude; " ; putStrLn "1 -> after the noise reduction the program additionally to the 0-processing truncates the silence from the beginning and end of the audio to the level given by the second command line parameter; "-; putStrLn "2 -> after the noise reduction the program additionally to the 1-processing applies a double band-reject filter to the audio (SoX \"sinc\" effect); "+; putStrLn "2 -> after the noise reduction the program additionally to the 1-processing applies a double band-reject filter to the audio (SoX \'sinc\' effect); " ; putStrLn "3 -> after the noise reduction the program additionally to the 2-processing applies fade-in and fade-out effects to the audio; " ; putStrLn "_ -> is the same as 3. " ; putStrLn ""@@ -224,18 +228,29 @@ ; produceSound3 (actsctrl, noiseLim) (file, file1) soundUkr (noiseMax, duration0) lim0 ; cleanTemp } --- | 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 +-- | Function to get the @(Double, Bool)@ value. The @Double@ value shows in how many times you expect that your sound representation+-- will be longer than the one provided by the @mmsyn6ukr@ package. The second one specifies whether the program uses a \'sharp\' mode meaning that+-- it does not check whether the resulting duration of the recording is at least 3 seconds long, so you can specify shorter durations.+tempS :: String -> IO (Double, Bool)+tempS soundUkr = onException (do+    putStrLn ""+    putStr "IMPORTANT. Would you like to use a \'sharp\' mode for this sound representaiion? (Enter \'*\' as the first symbol in your next input to use the "+    putStr "\'sharp\' mode, in which the program does not use 3 seconds minimal limit to record the sound representation, "+    putStr "but a recording duration is no more than the one specified by your entered ratio). For not using the \'sharp\' mode, "+    putStrLn "enter your next input without the asterisk."+    putStrLn ""     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!"-      tempS soundUkr)+    putStrLn "will sound longer than the recently played one? Specify your input as a Double value without \'e\' notation (with the preceding asterisk sign for the \'sharp\' mode). "+    longivityZ <- getLine+    let sharp0 = take 1 longivityZ+    case sharp0 of+      "*" -> let long = read (drop 1 longivityZ)::Double in return (long,True)+      _   -> let long = read longivityZ::Double in return (long,False)) (do +               putStrLn "Please, specify again the valid values!"+               tempS soundUkr)  -- | Function 'cleanTemp' removes all the intermediate temporary files in the directory where it is called from. cleanTemp :: IO ()
README view
@@ -125,3 +125,13 @@ just that non-silent representations for the Ukrainian sounds,  which are given. The list must be sorted. +You can create a sound in either a 'sharp' mode or in a usual mode.+The first one means that the program does not check whether the+specified duration for recording the initial sound data+is greater than 3 seconds. It put the responsibility for the sound more+to the user, so for a beginning it is not recommended (though you can+give it a try).++To use the program properly, check whether the system has included the+Ukrainian localization.+
mmsyn7ukr.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                mmsyn7ukr-version:             0.6.3.0+version:             0.7.0.0 synopsis:            A simple basic interface to some SoX functionality or to produce a voice that can be used by mmsyn7h description:         A program and a library that can be used as a simple basic interface to some SoX functionality or to produce your voice in Ukrainian (if you pronounce the sounds properly) represented by the separate sounds or something special like soft sign. homepage:            https://hackage.haskell.org/package/mmsyn7ukr