27 lines
761 B
Haskell
27 lines
761 B
Haskell
module Dodge.SoundLogic.LoadSound
|
|
( module Dodge.SoundLogic.LoadSound
|
|
, module Dodge.SoundLogic.ExternallyGeneratedSounds
|
|
) where
|
|
--import Sound.Data
|
|
import Dodge.SoundLogic.ExternallyGeneratedSounds
|
|
|
|
import qualified Data.IntMap.Strict as IM
|
|
import qualified SDL.Mixer as Mix
|
|
|
|
loadSound :: (Int,String) -> IO (Int, Mix.Chunk)
|
|
loadSound (i,s) = do
|
|
chnk <- Mix.load $ "./data/sound/" ++ s
|
|
return (i,chnk)
|
|
|
|
loadSounds :: IO (IM.IntMap Mix.Chunk)
|
|
loadSounds = do
|
|
Mix.openAudio Mix.defaultAudio 128
|
|
fmap IM.fromList $ mapM loadSound $ zip [0..] soundPathList
|
|
|
|
loadMusic :: IO (IM.IntMap Mix.Music)
|
|
loadMusic = do
|
|
undercity <- Mix.load "./data/music/firstCompo.mid"
|
|
return $ IM.fromList $ zip [0..]
|
|
[ undercity
|
|
]
|