Copyright | (c) OleksandrZhabenko 2019 |
---|---|
License | MIT |
Maintainer | olexandr543@yahoo.com |
Safe Haskell | None |
Language | Haskell2010 |
A program and a library that can be used as a simple basic interface to some SoX functionality or for producing the close to proper Ukrainian speech (if you pronounce the sounds properly) with your own recorded voice.
Synopsis
- maxAbs :: (String, String) -> (String, Bool)
- getMaxA :: FilePath -> (Int, Int) -> IO String
- getMinA :: FilePath -> (Int, Int) -> IO String
- selMaxAbs :: FilePath -> (Int, Int) -> IO (String, Bool)
- selMA :: FilePath -> (Int, Int) -> Bool -> IO String
- extremeS :: FilePath -> (Int, Int) -> Int -> IO (String, Bool) -> IO Int
- alterVadB :: FilePath -> Double -> IO ()
- norm :: FilePath -> IO ()
- normL :: FilePath -> Int -> IO ()
- soxStat :: FilePath -> IO ()
- alterVadE :: FilePath -> Double -> IO ()
- upperBnd :: FilePath -> IO Int
- extremeS1 :: FilePath -> IO Int
- quarterSinFade :: FilePath -> IO ()
- silenceBoth :: FilePath -> Int -> Int -> IO ()
- cleanTemp :: IO ()
- recA :: FilePath -> Double -> IO ()
- resampleA :: FilePath -> Int -> IO ()
- durationA :: FilePath -> IO Double
- playA :: FilePath -> IO ()
- noiseProfB :: FilePath -> IO ()
- noiseProfE :: FilePath -> IO ()
- noiseReduceB :: FilePath -> IO ()
- noiseReduceE :: FilePath -> IO ()
- volS :: FilePath -> Double -> IO ()
- volS2 :: FilePath -> FilePath -> IO ()
- sincA :: FilePath -> IO ()
Documentation
maxAbs :: (String, String) -> (String, Bool) Source #
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
getMaxA :: FilePath -> (Int, Int) -> IO String Source #
Function getMaxA
returns a maximum amplitude of the sound in the file in the given lower and upper bounds represented as a tuple of Int
values.
getMinA :: FilePath -> (Int, Int) -> IO String Source #
Function getMinA
returns a minimum amplitude of the sound in the file in the given lower and upper bounds represented as a tuple of Int
values.
selMaxAbs :: FilePath -> (Int, Int) -> IO (String, Bool) Source #
Function selMaxAbs
returns a maximum by absolute value amplitude of the sound and allows by its second value in the tuple determine whether it is a maximum or minimum.
Bool True
corresponds to maximum value, False
- to minimum value.
selMA :: FilePath -> (Int, Int) -> Bool -> IO String Source #
Function selMA
returns a maximum or a minimum of the sound amplitude of the file depending on the Bool
value given.
Bool True
corresponds to maximum value, False
- to minimum value.
extremeS :: FilePath -> (Int, Int) -> Int -> IO (String, Bool) -> IO Int Source #
Function extremeS
returns an approximate sample number of the extremum, which will be used further for fade effect.
alterVadB :: FilePath -> Double -> IO () Source #
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
in the same directory that also the function is called from).
norm :: FilePath -> IO () Source #
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 mean the file of the FilePath
parameter must be
in the same directory that also the function is called from).
normL :: FilePath -> Int -> IO () Source #
Function normL
applies a SoX gain effect on the audio file with the maximum absolute dB value given by the Int
argument.
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
in the same directory that also the function is called from).
alterVadE :: FilePath -> Double -> IO () Source #
Function alterVadE
removes an approximate silence measured by the absolute value of the sound amplitude from the end 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
in the same directory that also the function is called from).
upperBnd :: FilePath -> IO Int Source #
Function upperBnd
returns a maximum number of samples for use in other functions.
extremeS1 :: FilePath -> IO Int Source #
Variant of the function extremeS
with all the additional information included.
quarterSinFade :: FilePath -> IO () Source #
Function quarterSinFade
applies a fade effect by SoX to the audio file with "q" type.
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
in the same directory that also the function is called from).
silenceBoth :: FilePath -> Int -> Int -> IO () Source #
Function silenceBoth
adds a silence to both ends of the audio.
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
in the same directory that also the function is called from).
Function cleanTemp
removes all the intermediate temporary files in the directory where it is called from.
recA :: FilePath -> Double -> IO () Source #
Function recA
records audio file with the given name and duration in seconds
resampleA :: FilePath -> Int -> IO () Source #
Function resampleA
changes the sample rate for the recorded audio for further processing.
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
in the same directory that also the function is called from).
durationA :: FilePath -> IO Double Source #
Function durationA
returns a duration of the audio file in seconds
noiseProfB :: FilePath -> IO () Source #
Function noiseProfB
creates with SoX a file containing a noise profile for the first 0.05 s of the audio file given
noiseProfE :: FilePath -> IO () Source #
Function noiseProfE
creates with SoX a file containing a noise profile for the last 0.05 s of the audio file given.
noiseReduceB :: FilePath -> IO () Source #
Function noiseReduceB
reduces with SoX a noise in the file given with the corresponding noise profile created with noiseProfB
function.
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
in the same directory that also the function is called from).
noiseReduceE :: FilePath -> IO () Source #
Function noiseReduceE
reduces with SoX a noise in the file given with the corresponding noise profile created with noiseProfE
function.
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
in the same directory that also the function is called from).
volS :: FilePath -> Double -> IO () Source #
Function volS
changes the given audio with the linear ratio for the amplitude so that the resulting amlitude is equal to the given Double
parameter.
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
in the same directory that also the function is called from).
volS2 :: FilePath -> FilePath -> IO () Source #
Function volS2
changes the given audio (the first FilePath
parameter, which must be normalized e. g. by the norm
function before) with
the linear ratio for the amplitude so that the resulting amlitude is equal to the maximum by absolute value amplitude for the file given
by the second FilePath
parameter. The function must be used with the first FilePath
parameter containing no directories in its name
(that mean the file of the first FilePath
parameter must be in the same directory that also the function is called from).