freesound-0.2.0: Access the Freesound Project database

Safe HaskellNone
LanguageHaskell98

Sound.Freesound

Contents

Description

This module provides access to the Freesound Project, a database of Creative Commons licensed sounds.

import qualified Network.HTTP.Conduit as HTTP

Synopsis

Searching

Users

getUser :: User a => a -> Freesound Detail Source

Get detailed information about a user.

getUserByName :: Text -> Freesound Detail Source

Get information about a user by name.

getBookmarkCategories :: Detail -> Freesound [Category] Source

Retrieve a list of a user's bookmark categories.

getSounds :: Pagination -> Detail -> Freesound Sounds Source

Retrieve a user's sounds. This is broken: the response doesn't contain the User.

getSounds_ :: Detail -> Freesound Sounds Source

Retrieve a user's sounds.

getPacks :: Detail -> Freesound Packs Source

Retrieve a user's packs.

Sounds

getSimilar :: Pagination -> Detail -> Freesound Sounds Source

Search for sounds in a certain coordinate region. geotagged :: ...

Content based search. contentSearch :: ...

Freesound API monad

data APIKey Source

API key required for each call to the Freesound server.

apiKeyFromString :: String -> APIKey Source

Construct an API key from a String.

data Freesound a Source

Freesound API monad for communication with the Freesound server.

runFreesound :: APIKey -> Freesound a -> IO a Source

Perform an API action and return the result.

data URI Source

Newtype wrapper of Network.URI.URI to avoid orphan instance.

getURI :: URI -> Freesound ByteString Source

Download the data referred to by a URI.

data Resource a Source

Resource URI.

resourceURI :: [Text] -> Query -> Resource a Source

Construct an API uri from path components and a query.

appendQuery :: QueryLike a => a -> Resource r -> Resource r Source

Append a query string to a resource URI.

getResource :: FromJSON a => Resource a -> Freesound a Source

Create a query item for the API key. apiKeyQuery :: Freesound HTTP.Query apiKeyQuery = do k <- Freesound $ R.asks apiKey return $ [("api_key", Just k)]

Download the resource referred to by a URI.