HSoundFile-0.2.2: Audio file reading/writingSource codeContentsIndex
Sound.File
Contents
Generic functions
Format-specific functions
Wave format
Description
Enable reading and writing of SoundFiles. This module defines several datatypes for multiple audio file formats. Each datatype is an instance of Data.Binary, enabling lazy conversion to and from Lazy Bytestrings using the decodeSoundFileBS function. The different soundfile datatypes are generally not used directly, but are converted to the generic SoundFile type.
Synopsis
module Sound.Base
decodeSoundFileBS :: Monad m => ByteString -> AudioMonad m SoundFile
decodeSoundFileHinted :: Monad m => SndFileType -> ByteString -> AudioMonad m SoundFile
getType :: Monad m => ByteString -> AudioMonad m SndFileType
getTypeFromName :: Monad m => FilePath -> AudioMonad m SndFileType
toWaveFile :: (SndFileCls a, Monad m) => a -> AudioMonad m WaveFile
Documentation
module Sound.Base
Generic functions
decodeSoundFileBS :: Monad m => ByteString -> AudioMonad m SoundFileSource
Decode a Lazy ByteString to a SoundFile. This should be used instead of Data.Binary decode to make sure that the correct file format is used.
decodeSoundFileHinted :: Monad m => SndFileType -> ByteString -> AudioMonad m SoundFileSource
Attempt to decode a soundfile as the specified type. Return Nothing on failure. This function may be faster than using decodeSoundFileBS if the type is known.
getType :: Monad m => ByteString -> AudioMonad m SndFileTypeSource
Find the SndFileType of a ByteString. This function assumes that at most the file will match one format. If more than one format matches, the first found will be the format used.
getTypeFromName :: Monad m => FilePath -> AudioMonad m SndFileTypeSource
Attempt to guess the SndFileType from the extension of the file. This does not check that the file actually is valid data.
Format-specific functions
Wave format
toWaveFile :: (SndFileCls a, Monad m) => a -> AudioMonad m WaveFileSource
Create a WaveFile from a SndFileCls
Produced by Haddock version 2.6.0