-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Interchange with the Audacity sound signal editor
--
-- This package provides functions for interchange with the Audacity
-- sound signal editor. Currently we support import and export of label
-- tracks, export of Audacity projects and limited import of tracks from
-- Audacity projects.
--
-- We provide some examples that are useful on its own:
--
--
-- - sox-split: Split an audio file according to a label
-- track. Audacity provides this function by itself. You can use
-- placeholders like %s and %02d in order to compose
-- the names of the parts from the labels and positions.
-- - sox-concat: Concatenate a sequence of sound files with
-- matching sampling rates and numbers of channels using SoX and generate
-- an Audacity label track file that shows the origins of the parts.
-- - audacity-concat: Create an Audacity project file
-- containing a virtual concatenation of the input sound files and a
-- label track showing the origins of the sound files.
-- - audacity-combine: Put several audio and label files into
-- tracks of a new Audacity project. Opening one or even multiple such
-- projects is much easier than loading individual tracks into
-- Audacity.
--
@package audacity
@version 0.0.2
module Sound.Audacity.LabelTrack
newtype T time label
Cons :: [Interval time label] -> T time label
[decons] :: T time label -> [Interval time label]
type Interval time label = ((time, time), label)
empty :: T time label
null :: T time label -> Bool
singleton :: (time, time) -> label -> T time label
fromAdjacentChunks :: (Num time) => [(time, label)] -> T time label
lift :: ([Interval time0 label0] -> [Interval time1 label1]) -> T time0 label0 -> T time1 label1
lift2 :: ([Interval time0 label0] -> [Interval time1 label1] -> [Interval time2 label2]) -> T time0 label0 -> T time1 label1 -> T time2 label2
-- | Format the times using a comma, which is certainly only correct in
-- German locale.
formatTime :: (RealFrac time) => time -> String
-- | You must make sure, that the time mapping function preserves the
-- order. This is not checked.
mapTime :: (time0 -> time1) -> T time0 label -> T time1 label
mapWithTime :: ((time, time) -> label0 -> label1) -> T time label0 -> T time label1
realTimes :: (Fractional time) => time -> T Int label -> T time label
mask :: (Ord time) => (time, time) -> T time label -> T time label
zipWithList :: (label0 -> label1 -> label2) -> [label0] -> T time label1 -> T time label2
writeFile :: (RealFrac time) => FilePath -> T time String -> IO ()
writeFileInt :: (RealFrac time) => time -> FilePath -> T Int String -> IO ()
parseTime :: (Fractional time) => String -> Maybe time
-- | Read label file in a strict way.
readFile :: (Fractional time) => FilePath -> IO (T time String)
instance (GHC.Show.Show time, GHC.Show.Show label) => GHC.Show.Show (Sound.Audacity.LabelTrack.T time label)
instance GHC.Base.Functor (Sound.Audacity.LabelTrack.T time)
instance Data.Foldable.Foldable (Sound.Audacity.LabelTrack.T time)
instance Data.Traversable.Traversable (Sound.Audacity.LabelTrack.T time)
instance Data.Semigroup.Semigroup (Sound.Audacity.LabelTrack.T time label)
instance GHC.Base.Monoid (Sound.Audacity.LabelTrack.T time label)
instance (Control.DeepSeq.NFData time, Control.DeepSeq.NFData label) => Control.DeepSeq.NFData (Sound.Audacity.LabelTrack.T time label)
module Sound.Audacity.Project.Track.Wave.Summary
newtype State
State :: Int -> State
type Monad m = ReaderT FilePath (StateT State m)
eval :: (Monad m) => FilePath -> Monad m a -> m a
data Handle
createHandle :: FilePath -> IO Handle
deleteHandle :: Handle -> IO ()
withHandle :: FilePath -> (Handle -> IO a) -> IO a
usingHandle :: (MonadIO io) => Handle -> Monad io a -> io a
data T
Cons :: Int -> Limits -> Vector Limits -> T
[length_] :: T -> Int
[limits_] :: T -> Limits
[content_] :: T -> Vector Limits
fromBlock :: Vector Float -> T
attachStarts :: [T] -> [(Int, T)]
sequenceFromStorableVector :: Int -> Vector Float -> [T]
reserve :: (Monad m) => Monad m State
data Limits
Limits :: Float -> Limits
[min_, max_, rms_] :: Limits -> Float
defltLimits :: Limits
storeLimits :: Dictionary Limits
summary :: Int -> Vector Float -> Vector Limits
instance GHC.Show.Show Sound.Audacity.Project.Track.Wave.Summary.T
instance GHC.Show.Show Sound.Audacity.Project.Track.Wave.Summary.Limits
instance Control.DeepSeq.NFData Sound.Audacity.Project.Track.Wave.Summary.T
instance Control.DeepSeq.NFData Sound.Audacity.Project.Track.Wave.Summary.Limits
instance Foreign.Storable.Storable Sound.Audacity.Project.Track.Wave.Summary.Limits
module Sound.Audacity.Project.Track.Wave
data T
Cons :: String -> Channel -> Bool -> Int -> Int -> Double -> [Clip] -> T
[name_] :: T -> String
[channel_] :: T -> Channel
[linked_, mute_, solo_, minimized_] :: T -> Bool
[height_] :: T -> Int
[rate_] :: T -> Int
[gain_, pan_] :: T -> Double
[clips_] :: T -> [Clip]
deflt :: T
data Channel
Left :: Channel
Right :: Channel
Mono :: Channel
data Clip
Clip :: Double -> Sequence -> Clip
[offset_] :: Clip -> Double
[sequence_] :: Clip -> Sequence
data Sequence
Sequence :: Int -> SampleFormat -> Int -> [Block] -> Sequence
[maxSamples_] :: Sequence -> Int
[sampleFormat_] :: Sequence -> SampleFormat
[numSamples_] :: Sequence -> Int
[blocks_] :: Sequence -> [Block]
data SampleFormat
Int16Sample :: SampleFormat
Int24Sample :: SampleFormat
FloatSample :: SampleFormat
intFromSampleFormat :: SampleFormat -> Int
data Block
Block :: Int -> BlockFile -> Block
[blockStart_, blockLength_] :: Block -> Int
[blockFile_] :: Block -> BlockFile
data BlockFile
PCMAliasBlockFile :: FilePath -> Int -> Int -> Limits -> BlockFile
[summaryFile_, aliasFile_] :: BlockFile -> FilePath
[aliasStart_] :: BlockFile -> Int
[aliasChannel_] :: BlockFile -> Int
[limits_] :: BlockFile -> Limits
toXML :: T -> [[T T String]]
clipToXML :: Clip -> [[T T String]]
sequenceToXML :: Sequence -> [[T T String]]
blockToXML :: Block -> [[T T String]]
-- | maxSamples_ must be at least 1024, otherwise you get an error
-- about clip values if you load the project to Audacity. However, 1024
-- is not necessarily a good value. Audacity uses 524288 by default.
pcmAliasSequence :: (Monad m) => SampleFormat -> Int -> Int -> FilePath -> Int -> Monad m Sequence
pcmAliasSequenceFromStorableVector :: (MonadIO m) => Int -> FilePath -> Int -> Vector Float -> Monad m Sequence
pcmAliasSequenceFromSummary :: (MonadIO m) => FilePath -> Int -> [T] -> Monad m Sequence
-- | This type lets you specify how to order blocks of multi-channel
-- sounds. Both orders always work but Haskell's garbage collector works
-- best, if the order matches the order of the data production.
data BlockOrder
-- | All blocks of a channel are stored adjacently.
Serial :: BlockOrder
-- | Blocks of channels are interleaved.
Interleaved :: BlockOrder
-- | It is an unchecked error if StorableVectors have different lengths.
pcmAliasSequencesFromStorableVectorChannels :: (MonadIO m) => BlockOrder -> Int -> FilePath -> [Vector Float] -> Monad m [Sequence]
pcmAliasSequencesFromChannelSummaries :: (MonadIO m) => BlockOrder -> FilePath -> [[T]] -> Monad m [Sequence]
blocksFromChannelSummaries :: (MonadIO m) => BlockOrder -> FilePath -> [[T]] -> Monad m [[Block]]
sequenceFromBlocks :: [Block] -> Sequence
sequenceFromBlocksSize :: Int -> [Block] -> Sequence
storeSummary :: MonadIO m => FilePath -> Int -> Int -> T -> Monad m Block
instance GHC.Enum.Bounded Sound.Audacity.Project.Track.Wave.BlockOrder
instance GHC.Enum.Enum Sound.Audacity.Project.Track.Wave.BlockOrder
instance GHC.Show.Show Sound.Audacity.Project.Track.Wave.BlockOrder
instance GHC.Classes.Ord Sound.Audacity.Project.Track.Wave.BlockOrder
instance GHC.Classes.Eq Sound.Audacity.Project.Track.Wave.BlockOrder
instance GHC.Show.Show Sound.Audacity.Project.Track.Wave.T
instance GHC.Show.Show Sound.Audacity.Project.Track.Wave.Clip
instance GHC.Show.Show Sound.Audacity.Project.Track.Wave.Sequence
instance GHC.Show.Show Sound.Audacity.Project.Track.Wave.Block
instance GHC.Show.Show Sound.Audacity.Project.Track.Wave.BlockFile
instance GHC.Show.Show Sound.Audacity.Project.Track.Wave.SampleFormat
instance GHC.Enum.Bounded Sound.Audacity.Project.Track.Wave.SampleFormat
instance GHC.Enum.Enum Sound.Audacity.Project.Track.Wave.SampleFormat
instance GHC.Classes.Ord Sound.Audacity.Project.Track.Wave.SampleFormat
instance GHC.Classes.Eq Sound.Audacity.Project.Track.Wave.SampleFormat
instance GHC.Show.Show Sound.Audacity.Project.Track.Wave.Channel
instance GHC.Enum.Enum Sound.Audacity.Project.Track.Wave.Channel
instance GHC.Classes.Ord Sound.Audacity.Project.Track.Wave.Channel
instance GHC.Classes.Eq Sound.Audacity.Project.Track.Wave.Channel
module Sound.Audacity.Project.Track.Label
data T
Cons :: String -> Int -> Bool -> T Double String -> T
[name_] :: T -> String
[height_] :: T -> Int
[minimized_] :: T -> Bool
[track_] :: T -> T Double String
deflt :: T
toXML :: T -> [[T T String]]
intervalToXML :: Interval Double String -> [T T String]
tracksFromXML :: [T T String] -> Exceptional Message [T]
-- | Currently we ignore the numlabels attribute. Alternatively we
-- could check whether that value matches the number of read intervals.
parse :: T T
parseInterval :: T (Interval Double String)
labelName :: Name T
labeltrackName :: Name T
instance GHC.Show.Show Sound.Audacity.Project.Track.Label.T
module Sound.Audacity.Project
data T
Cons :: String -> Double -> Int -> Double -> Double -> Double -> [Track] -> T
[name_] :: T -> String
[selectionStart_, selectionEnd_] :: T -> Double
[vpos_] :: T -> Int
[h_] :: T -> Double
[zoom_] :: T -> Double
[rate_] :: T -> Double
[tracks_] :: T -> [Track]
deflt :: T
data Track
WaveTrack :: T -> Track
LabelTrack :: T -> Track
format :: T -> ShowS
toXML :: T -> [[T T String]]
trackToXML :: Track -> [[T T String]]