mmsyn7ukr-array-0.2.0.0: 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
Copyright(c) OleksandrZhabenko 2020-2022
LicenseMIT
Maintainerolexandr543@yahoo.com
StabilityExperimental
Safe HaskellNone
LanguageHaskell2010

SoXBasics1.Arr

Description

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). This module differs from a SoXBasics that the resulting files in it have possibly just the same name as the input ones. The functions try to replace the initial file with the processed one.

Synopsis

Produce sound

Amplitude modification

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 means the file of the FilePath parameter must be in the same directory where the function is called from). While being executed the function tries to replace the initial file with the resulting processed one and to clean the temporary files. If it is not successful the function exits with exception of the type FinalException and leaves the initial file without modification.

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 means the file of the FilePath parameter must be in the same directory where the function is called from). While being executed the function tries to replace the initial file with the resulting processed one and to clean the temporary files. If it is not successful the function exits with exception of the type FinalException and leaves the initial file without modification.

gainL :: FilePath -> Float -> IO () Source #

Function normL applies a SoX "gain -b [db-Value]" effect on the audio file with dB value given by the Float argument. 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 in the same directory where the function is called from). While being executed the function tries to replace the initial file with the resulting processed one and to clean the temporary files. If it is not successful the function exits with exception of the type FinalException and leaves the initial file without modification.

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 means the file of the FilePath parameter must be in the same directory where the function is called from). While being executed the function tries to replace the initial file with the resulting processed one and to clean the temporary files. If it is not successful the function exits with exception of the type FinalException and leaves the initial file without modification.

Adding silence

silenceBoth :: FilePath -> Int -> Int -> IO () Source #

Function silenceBoth adds some silence to both ends of the audio. 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 in the same directory where the function is called from). While being executed the function tries to replace the initial file with the resulting processed one and to clean the temporary files. If it is not successful the function exits with exception of the type FinalException and leaves the initial file without modification.

Changing sample rate

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 means the file of the FilePath parameter must be in the same directory where the function is called from). While being executed the function tries to replace the initial file with the resulting processed one and to clean the temporary files. If it is not successful the function exits with exception of the type FinalException and leaves the initial file without modification.

Working with noise

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 means the file of the FilePath parameter must be in the same directory where the function is called from). While being executed the function tries to replace the initial file with the resulting processed one and to clean the temporary files. If it is not successful the function exits with exception of the type FinalException and leaves the initial file without modification.

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 means the file of the FilePath parameter must be in the same directory where the function is called from). While being executed the function tries to replace the initial file with the resulting processed one and to clean the temporary files. If it is not successful the function exits with exception of the type FinalException and leaves the initial file without modification.

noiseReduceBU :: FilePath -> Float -> IO () Source #

Function noiseReduceBU reduces with SoX a noise in the file given with the corresponding noise profile created with noiseProfBU function. 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 in the same directory where the function is called from). The Float parameter is a number between 0 and 1 showing the level of reducing the noise (the greater number means that the function will reduce more intensively may be even aggressively so that for greater numbers it can remove some sensitive and important sound data as a noise). Internally this parameter is passed unchanged to the "sox" so that it uses it as an amount parameter for the "noisered" effect. Therefore, please, (as being stated in the SoX manual) experiment with the amount to get suitable results. While being executed the function tries to replace the initial file with the resulting processed one and to clean the temporary files. If it is not successful the function exits with exception of the type FinalException and leaves the initial file without modification.

noiseReduceEU :: FilePath -> Float -> IO () Source #

Function noiseReduceEU 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 means the file of the FilePath parameter must be in the same directory where the function is called from). The Float parameter is a number between 0 and 1 showing the level of reducing the noise (the greater number means that the function will reduce more intensively may be even aggressively so that for greater numbers it can remove some sensitive and important sound data as a noise). Internally this parameter is passed unchanged to the "sox" so that it uses it as an amount parameter for the "noisered" effect. Therefore, please, (as being stated in the SoX manual) experiment with the amount to get suitable results. While being executed the function tries to replace the initial file with the resulting processed one and to clean the temporary files. If it is not successful the function exits with exception of the type FinalException and leaves the initial file without modification.

Filtering

sincA :: FilePath -> IO () Source #

Function sincA uses a "sinc" effect with -a 50 -I 0.07k-11k band-pass filter for the audio file given. While being executed the function tries to replace the initial file with the resulting processed one and to clean the temporary files. If it is not successful the function exits with exception of the type FinalException and leaves the initial file without modification.

Volume amplification

volS :: FilePath -> Float -> 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 Float parameter. 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 in the same directory where the function is called from). While being executed the function tries to replace the initial file with the resulting processed one and to clean the temporary files. If it is not successful the function exits with exception of the type FinalException and leaves the initial file without modification.

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 means the file of the first FilePath parameter must be in the same directory where the function is called from). While being executed the function tries to replace the initial file with the resulting processed one and to clean the temporary files. If it is not successful the function exits with exception of the type FinalException and leaves the initial file without modification.