synthesizer-core-0.5.2: Audio signal processing coded in Haskell: Low level part

Safe HaskellNone

Synthesizer.Plain.File

Synopsis

Documentation

render :: (Storable int, C int, C int, Bounded int, C a, C v) => Put int -> FilePath -> a -> (a -> [v]) -> IO ExitCodeSource

See write.

renderToInt16 :: (C a, C v) => FilePath -> a -> (a -> [v]) -> IO ExitCodeSource

renderMonoToInt16 :: C a => FilePath -> a -> (a -> [a]) -> IO ExitCodeSource

renderStereoToInt16 :: C a => FilePath -> a -> (a -> [(a, a)]) -> IO ExitCodeSource

write :: (Storable int, C int, C int, Bounded int, C a, C v) => Put int -> FilePath -> a -> [v] -> IO ExitCodeSource

The output format is determined by SoX by the file name extension. The sample precision is determined by the provided Put function.

Example:

 import qualified Synthesizer.Plain.Builder as Builder

 write (Builder.put :: Builder.Put Int16) "test.aiff" 44100 sound

writeToInt16 :: (C a, C v) => FilePath -> a -> [v] -> IO ExitCodeSource

writeStereoToInt16 :: C a => FilePath -> a -> [(a, a)] -> IO ExitCodeSource

writeRaw :: (C a, C v, Storable v) => T -> FilePath -> a -> [v] -> IO ExitCodeSource

writeRawCompressed :: (C a, C v, Storable v) => T -> FilePath -> a -> [v] -> IO ExitCodeSource

You hardly need this routine since you can use a filename with .mp3 or .ogg extension for writeRaw and SoX will do the corresponding compression for you.

rawToAIFF :: C a => FilePath -> T -> a -> Int -> IO ExitCodeSource

Deprecated: If you want to generate AIFF, then just write to files with .aiff filename extension. If you want to convert files to AIFF, use Sound.Sox.Convert.

readAIFFMono :: C a => FilePath -> IO [a]Source

Deprecated: Use readMonoFromInt16 instead

readMonoFromInt16 :: C a => FilePath -> IO [a]Source

I suspect we cannot handle file closing properly.

getInt16List :: Get [Int16]Source

Deprecated: This function will no longer be exported