Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
ProteaAudio is a stereo audio mixer/playback library for Linux (native ALSA, Jack, and OSS), Macintosh OS X (CoreAudio and Jack), and Windows (DirectSound and ASIO) operating systems.
- initAudio :: Int -> Int -> Int -> IO Bool
- finishAudio :: IO ()
- loaderAvailable :: String -> IO Bool
- volume :: Float -> Float -> IO ()
- sampleFromMemoryWav :: ByteString -> Float -> IO Sample
- sampleFromMemoryOgg :: ByteString -> Float -> IO Sample
- sampleFromFile :: String -> Float -> IO Sample
- soundActive :: IO Int
- soundStopAll :: IO ()
- soundLoop :: Sample -> Float -> Float -> Float -> Float -> IO ()
- soundPlay :: Sample -> Float -> Float -> Float -> Float -> IO ()
- soundUpdate :: Sample -> Float -> Float -> Float -> Float -> IO Bool
- soundStop :: Sample -> IO Bool
- data Sample
Documentation
:: Int | the maximum number of sounds that are played parallely. Computation time is linearly correlated to this factor. |
-> Int | sample frequency of the playback in Hz. 22050 corresponds to FM radio 44100 is CD quality. Computation time is linearly correlated to this factor. |
-> Int | the number of bytes that are sent to the sound card at once. Low numbers lead to smaller latencies but need more computation time (thread switches). If a too small number is chosen, the sounds might not be played continuously. The default value 512 guarantees a good latency below 40 ms at 22050 Hz sample frequency. |
-> IO Bool | returns True on success |
finishAudio :: IO () Source #
releases the audio device and cleans up resources
checks if loader for this file type is available
:: ByteString | wav sample data |
-> Float | volume |
-> IO Sample | return sample handle |
loads wav sound sample from memory buffer
:: ByteString | ogg sample data |
-> Float | volume |
-> IO Sample | return sample handle |
loads ogg sound sample from memory buffer
loads a sound sample from file
soundActive :: IO Int Source #
number of currently active sounds
soundStopAll :: IO () Source #
stops all sounds immediately
:: Sample | handle of a previously loaded sample |
-> Float | left volume |
-> Float | right volume |
-> Float | time difference between left and right channel in seconds. Use negative values to specify a delay for the left channel, positive for the right |
-> Float | pitch factor for playback. 0.5 corresponds to one octave below, 2.0 to one above the original sample |
-> IO () |
plays a specified sound sample continuously and sets its parameters
:: Sample | handle of a previously loaded sample |
-> Float | left volume |
-> Float | right volume |
-> Float | time difference between left and right channel in seconds. Use negative values to specify a delay for the left channel, positive for the right |
-> Float | pitch factor for playback. 0.5 corresponds to one octave below, 2.0 to one above the original sample |
-> IO () |
plays a specified sound sample once and sets its parameters
:: Sample | handle of a currently active sound |
-> Float | left volume |
-> Float | right volume |
-> Float | time difference between left and right channel in seconds. Use negative values to specify a delay for the left channel, positive for the right |
-> Float | pitch factor for playback. 0.5 corresponds to one octave below, 2.0 to one above the original sample |
-> IO Bool | return True in case the parameters have been updated successfully |
updates parameters of a specified sound