Copyright | (c) Oleksandr Zhabenko 2019-2024 |
---|---|
License | MIT |
Maintainer | oleksandr.zhabenko@yahoo.com |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- type SoXEffects = [String]
- soxE :: FilePath -> SoXEffects -> IO ()
- w2f :: FilePath -> FilePath
- f2w :: FilePath -> FilePath
- wOrf :: FilePath -> String
- cfw2wf :: FilePath -> FilePath
- efw2 :: FilePath -> String
- efw2vv :: FilePath -> String
- fadeEnds :: FilePath -> IO ()
- fadeEndsMilN :: Int -> FilePath -> IO ()
- fadeEndsTMN :: Char -> Float -> Float -> FilePath -> IO ()
- fadeEndsTMB :: Char -> Float -> FilePath -> IO ()
- takeU :: ByteString -> ByteString
- getMaxAG :: ULencode -> FilePath -> (Int, Int) -> IO ByteString
- getMinAG :: ULencode -> FilePath -> (Int, Int) -> IO ByteString
- selMaxAbsG :: ULencode -> FilePath -> (Int, Int) -> IO (ByteString, Bool)
- data ULencode
- class SoundFileExts a where
- soxOpG1 :: ULencode -> [String] -> FilePath -> [String] -> [String] -> IO (ExitCode, ByteString, ByteString)
- durationAG :: ULencode -> FilePath -> IO Float
- durationA :: FilePath -> IO Float
- upperBndG :: ULencode -> FilePath -> IO Int
- selMaxAbs :: FilePath -> (Int, Int) -> IO (ByteString, Bool)
- maxAbs :: (ByteString, ByteString) -> (ByteString, Bool)
- ulAccessParameters :: [String]
Documentation
type SoXEffects = [String] Source #
soxE :: FilePath -> SoXEffects -> IO () Source #
Takes a filename to be applied a SoX chain of effects as list of String
(the second argument). Produces the temporary
new file with the name ((name-of-the-file) ++ ("effects.wav" OR "effects.flac") -- the type is preserved), which then is removed.
The syntaxis is that every separate literal for SoX must be a new element in the list. Please, for more information, refer to SoX documentation.
Please, check by yourself whether you have enough permissions to work with the corresponding FilePath
s.
fadeEnds :: FilePath -> IO () Source #
Applies "fade q" effect to both ends of the supported by SoX sound file FilePath
so that concatenating them consequently after such application
leads to no clipping. Otherwise, the clipping exists if not prevented by may be some other means. For more information, please, refer to the
SoX documentation.
fadeEndsMilN :: Int -> FilePath -> IO () Source #
Applies "fade q" effect to both ends of the supported by SoX sound file FilePath
so that concatenating them consequently after such application
leads to no clipping. Otherwise, the clipping exists if not prevented by may be some other means. The duration of the changes are usually
smaller than for fadeEnds
function and is equal to 0.001 * n sec (where n is in range [1..10]).
For more information, please, refer to the SoX documentation.
fadeEndsTMN :: Char -> Float -> Float -> FilePath -> IO () Source #
Applies "fade" effect (the type is specified by the Char
argument, for more information, please, refer to the SoX documentation) to the both ends
of the sound with header (supported by SoX). The Float
arguments specify the percentages of the length of the sound that is faded-in and faded-out
respectively. Otherwise, the function returns an error.
fadeEndsTMB :: Char -> Float -> FilePath -> IO () Source #
Variant of the fadeEndsTMN
with the both equal percentages specified by the Float
argument. It must be in the range (0..50]. Otherwise, the function
returns error.
takeU :: ByteString -> ByteString Source #
selMaxAbsG :: ULencode -> FilePath -> (Int, Int) -> IO (ByteString, Bool) Source #
Function selMaxAbsG
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.
class SoundFileExts a where Source #
soxOpG1 :: ULencode -> [String] -> FilePath -> [String] -> [String] -> IO (ExitCode, ByteString, ByteString) Source #
The variant of the soxOpG
that is used if the second file is not used (or in the situation where some
other file is used, too, e. g. with the .prof extension). For the functions in the module, this corresponds
to the "-n" second file argument.
durationAG :: ULencode -> FilePath -> IO Float Source #
Function durationAG
returns a duration of the audio file in seconds.
durationA :: FilePath -> IO Float Source #
A variant of the durationAG
with the first argument being W
.
upperBndG :: ULencode -> FilePath -> IO Int Source #
Function upperBndG
returns a maximum number of samples for use in other functions.
selMaxAbs :: FilePath -> (Int, Int) -> IO (ByteString, Bool) Source #
A variant of the selMaxAbsG
with the first argument being W
.
maxAbs :: (ByteString, ByteString) -> (ByteString, Bool) Source #
Function maxAbs
allows to choose a maximum by absolute value if the values are written as ByteString
. Bool True
corresponds to maximum value, False
- to minimum value
ulAccessParameters :: [String] Source #