packages feed

ALUT 2.1.0.1 → 2.1.0.2

raw patch · 16 files changed

+497/−16 lines, 16 filesbinary-addedPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

ALUT.cabal view
@@ -1,10 +1,10 @@ name:		ALUT-version:	2.1.0.1+version:	2.1.0.2 license:	BSD3 license-file:	LICENSE maintainer:	Sven Panne <sven.panne@aedion.de> bug-reports:	mailto:sven.panne@aedion.de-homepage:	http://www.openal.org/+homepage:	http://connect.creativelabs.com/openal/ category:	Sound synopsis:	A binding for the OpenAL Utility Toolkit description:@@ -12,12 +12,17 @@ 	managing of OpenAL contexts, loading sounds in various formats 	and creating waveforms very easy. For more information about the 	C library on which this binding is based, please see:-	<http://www.openal.org/openal_webstf/specs/alut.html>.+	<http://connect.creativelabs.com/openal/Documentation/The%20OpenAL%20Utility%20Toolkit.pdf>. build-type:     Configure extra-source-files:-	config.guess config.sub install-sh-	configure.ac configure ALUT.buildinfo.in-	include/HsALUTConfig.h.in include/HsALUT.h.in+	ALUT.buildinfo.in README aclocal.m4 config.guess config.sub configure+	configure.ac examples/Basic/HelloWorld.hs examples/Basic/OpenALInfo.hs+	examples/Basic/PlayFile.hs examples/TestSuite/TestErrorStuff.hs+	examples/TestSuite/TestFileLoader.hs+	examples/TestSuite/TestMemoryLoader.hs examples/TestSuite/TestVersion.hs+	examples/TestSuite/TestWaveforms.hs examples/TestSuite/file1.wav+	examples/TestSuite/file2.au examples/TestSuite/file3.raw+	include/HsALUT.h.in include/HsALUTConfig.h.in install-sh extra-tmp-files: 	config.log config.status autom4te.cache 	ALUT.buildinfo include/HsALUTConfig.h include/HsALUT.h
+ README view
@@ -0,0 +1,4 @@+To build this package using Cabal directly from darcs, you must run+"autoreconf" before the usual Cabal build steps (configure/build/install).+autoreconf is included in the GNU autoconf tools.  There is no need to run+the "configure" script: the "setup configure" step will do this for you.
+ aclocal.m4 view
@@ -0,0 +1,190 @@+# FP_COMPUTE_INT(EXPRESSION, VARIABLE, INCLUDES, IF-FAILS)+# ---------------------------------------------------------+# Assign VARIABLE the value of the compile-time EXPRESSION using INCLUDES for+# compilation. Execute IF-FAILS when unable to determine the value. Works for+# cross-compilation, too.+#+# Implementation note: We are lazy and use an internal autoconf macro, but it+# is supported in autoconf versions 2.50 up to the actual 2.57, so there is+# little risk.+AC_DEFUN([FP_COMPUTE_INT],+[_AC_COMPUTE_INT([$1], [$2], [$3], [$4])[]dnl+])# FP_COMPUTE_INT+++# FP_CHECK_CONST(EXPRESSION, [INCLUDES = DEFAULT-INCLUDES], [VALUE-IF-FAIL = -1])+# -------------------------------------------------------------------------------+# Defines CONST_EXPRESSION to the value of the compile-time EXPRESSION, using+# INCLUDES. If the value cannot be determined, use VALUE-IF-FAIL.+AC_DEFUN([FP_CHECK_CONST],+[AS_VAR_PUSHDEF([fp_Cache], [fp_cv_const_$1])[]dnl+AC_CACHE_CHECK([value of $1], fp_Cache,+[FP_COMPUTE_INT([$1], fp_check_const_result, [AC_INCLUDES_DEFAULT([$2])],+                [fp_check_const_result=m4_default([$3], ['-1'])])+AS_VAR_SET(fp_Cache, [$fp_check_const_result])])[]dnl+AC_DEFINE_UNQUOTED(AS_TR_CPP([CONST_$1]), AS_VAR_GET(fp_Cache), [The value of $1.])[]dnl+AS_VAR_POPDEF([fp_Cache])[]dnl+])# FP_CHECK_CONST+++# FP_CHECK_CONSTS_TEMPLATE(EXPRESSION...)+# ---------------------------------------+# autoheader helper for FP_CHECK_CONSTS+m4_define([FP_CHECK_CONSTS_TEMPLATE],+[AC_FOREACH([fp_Const], [$1],+  [AH_TEMPLATE(AS_TR_CPP(CONST_[]fp_Const),+               [The value of ]fp_Const[.])])[]dnl+])# FP_CHECK_CONSTS_TEMPLATE+++# FP_CHECK_CONSTS(EXPRESSION..., [INCLUDES = DEFAULT-INCLUDES], [VALUE-IF-FAIL = -1])+# -----------------------------------------------------------------------------------+# List version of FP_CHECK_CONST+AC_DEFUN([FP_CHECK_CONSTS],+[FP_CHECK_CONSTS_TEMPLATE([$1])dnl+for fp_const_name in $1+do+FP_CHECK_CONST([$fp_const_name], [$2], [$3])+done+])# FP_CHECK_CONSTS++# FP_ARG_OPENAL+# -------------+AC_DEFUN([FP_ARG_OPENAL],+[AC_ARG_ENABLE([openal],+  [AC_HELP_STRING([--enable-openal],+    [build a Haskell binding for OpenAL (default=autodetect)])],+  [enable_openal=$enableval],+  [enable_openal=yes])+])# FP_ARG_OPENAL+++# FP_ARG_ALUT+# -------------+AC_DEFUN([FP_ARG_ALUT],+[AC_ARG_ENABLE([alut],+  [AC_HELP_STRING([--enable-alut],+    [build a Haskell binding for ALUT (default=autodetect)])],+  [enable_alut=$enableval],+  [enable_alut=yes])+])# FP_ARG_ALUT+++# FP_CHECK_ALUT+# -------------+AC_DEFUN([FP_CHECK_ALUT],+[AC_REQUIRE([AC_CANONICAL_TARGET])+ALUT_CFLAGS=+case $target_os in+darwin*)+  ALUT_LIBS=+  ALUT_FRAMEWORKS=ALUT+  ;;+*)+  AL_LIBS=no+  AC_SEARCH_LIBS([alGenSources], [openal openal32], [AL_LIBS="$ac_cv_search_alGenSources"])+  test x"$AL_LIBS" = x"none required" && AL_LIBS=++  fp_save_libs="$LIBS"+  LIBS="$AL_LIBS $LIBS"+  AC_SEARCH_LIBS([alutExit], [alut alut32], [ALUT_LIBS="$ac_cv_search_alutExit"])+  test x"$ALUT_LIBS" = x"none required" && ALUT_LIBS=+  LIBS="$fp_save_libs"+  ALUT_FRAMEWORKS=+  ;;+esac+AC_SUBST([ALUT_CFLAGS])+AC_SUBST([ALUT_LIBS])+AC_SUBST([ALUT_FRAMEWORKS])+])# FP_CHECK_ALUT+++# FP_HEADER_ALUT+# --------------+# Check for an ALUT header, setting the variable fp_found_alut_header to no/yes,+# depending on the outcome.+AC_DEFUN([FP_HEADER_ALUT],+[if test -z "$fp_found_alut_header"; then+  fp_found_alut_header=no+  AC_CHECK_HEADERS([AL/alut.h OpenAL/alut.h], [fp_found_alut_header=yes; break])+fi+]) # FP_HEADER_AL+++# FP_CHECK_FUNC_ALUT(FUNCTION, ARGUMENTS)+# ---------------------------------------+AC_DEFUN([FP_CHECK_FUNC_ALUT],+[AS_VAR_PUSHDEF([alut_var], [alut_cv_func_$1])dnl+AC_CACHE_CHECK([for $1],+  alut_var,+  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_AL_ALUT_H+#include <AL/alut.h>+#elif HAVE_OPENAL_ALUT_H+#include <OpenAL/alut.h>+#endif]],+                    [$1 $2;])],+                  [AS_VAR_SET(alut_var, yes)],+                  [AS_VAR_SET(alut_var, no)])])+if test AS_VAR_GET(alut_var) = yes; then+  AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1]), [1],+                    [Define to 1 if you have the `$1' function.])+fi+AS_VAR_POPDEF([alut_var])dnl+])# FP_CHECK_FUNC_ALUT+++# FP_FUNC_ALUTINIT_VOID+# ---------------------+# Defines ALUTINIT_VOID to 1 if `alutInit' returns void.+AC_DEFUN([FP_FUNC_ALUTINIT_VOID],+[AC_REQUIRE([FP_HEADER_ALUT])+AC_CACHE_CHECK([whether alutInit returns void],+  [fp_cv_func_alutInit_void],+  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT+#if HAVE_AL_ALUT_H+#include <AL/alut.h>+#elif HAVE_OPENAL_ALUT_H+#include <OpenAL/alut.h>+#endif+],+ [[int x = (int)alutInit((int *)0, (char **)0);]])],+ [fp_cv_func_alutInit_void=no],+ [fp_cv_func_alutInit_void=yes])])+if test x"$fp_cv_func_alutInit_void" = xyes; then+  AC_DEFINE([ALUTINIT_VOID], [1], [Define to 1 if `alutInit' returns void.])+fi+]) # FP_FUNC_ALUTINIT_VOID+++# FP_FUNC_ALUTEXIT_VOID+# ---------------------+# Defines ALUTEXIT_VOID to 1 if `alutExit' returns void.+AC_DEFUN([FP_FUNC_ALUTEXIT_VOID],+[AC_REQUIRE([FP_HEADER_ALUT])+AC_CACHE_CHECK([whether alutExit returns void],+  [fp_cv_func_alutExit_void],+  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT+#if HAVE_AL_ALUT_H+#include <AL/alut.h>+#elif HAVE_OPENAL_ALUT_H+#include <OpenAL/alut.h>+#endif+],+ [[int x = (int)alutExit();]])],+ [fp_cv_func_alutExit_void=no],+ [fp_cv_func_alutExit_void=yes])])+if test x"$fp_cv_func_alutExit_void" = xyes; then+  AC_DEFINE([ALUTEXIT_VOID], [1], [Define to 1 if `alutExit' returns void.])+fi+]) # FP_FUNC_ALUTEXIT_VOID+++# FP_ARG_COMPILER+# -------------+AC_DEFUN([FP_ARG_COMPILER],+[AC_ARG_WITH([compiler],+  [AC_HELP_STRING([--with-compiler@<:@=HC@:>@],+    [use the given Haskell compiler (default=ghc)])],+  [with_compiler=$withval],+  [with_compiler=ghc])+])# FP_ARG_COMPILER
configure view
@@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles.-# Generated by GNU Autoconf 2.63 for Haskell ALUT package 2.1.0.1.+# Generated by GNU Autoconf 2.63 for Haskell ALUT package 2.1.0.2. # # Report bugs to <sven.panne@aedion.de>. #@@ -596,8 +596,8 @@ # Identity of this package. PACKAGE_NAME='Haskell ALUT package' PACKAGE_TARNAME='ALUT'-PACKAGE_VERSION='2.1.0.1'-PACKAGE_STRING='Haskell ALUT package 2.1.0.1'+PACKAGE_VERSION='2.1.0.2'+PACKAGE_STRING='Haskell ALUT package 2.1.0.2' PACKAGE_BUGREPORT='sven.panne@aedion.de'  ac_unique_file="include/HsALUT.h.in"@@ -1270,7 +1270,7 @@   # Omit some internal or obsolete options to make the list less imposing.   # This message is too long to be a string in the A/UX 3.1 sh.   cat <<_ACEOF-\`configure' configures Haskell ALUT package 2.1.0.1 to adapt to many kinds of systems.+\`configure' configures Haskell ALUT package 2.1.0.2 to adapt to many kinds of systems.  Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1336,7 +1336,7 @@  if test -n "$ac_init_help"; then   case $ac_init_help in-     short | recursive ) echo "Configuration of Haskell ALUT package 2.1.0.1:";;+     short | recursive ) echo "Configuration of Haskell ALUT package 2.1.0.2:";;    esac   cat <<\_ACEOF @@ -1428,7 +1428,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then   cat <<\_ACEOF-Haskell ALUT package configure 2.1.0.1+Haskell ALUT package configure 2.1.0.2 generated by GNU Autoconf 2.63  Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,@@ -1442,7 +1442,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Haskell ALUT package $as_me 2.1.0.1, which was+It was created by Haskell ALUT package $as_me 2.1.0.2, which was generated by GNU Autoconf 2.63.  Invocation command line was    $ $0 $@@@ -6142,7 +6142,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log="-This file was extended by Haskell ALUT package $as_me 2.1.0.1, which was+This file was extended by Haskell ALUT package $as_me 2.1.0.2, which was generated by GNU Autoconf 2.63.  Invocation command line was    CONFIG_FILES    = $CONFIG_FILES@@ -6201,7 +6201,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\-Haskell ALUT package config.status 2.1.0.1+Haskell ALUT package config.status 2.1.0.2 configured by $0, generated by GNU Autoconf 2.63,   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" 
configure.ac view
@@ -1,4 +1,4 @@-AC_INIT([Haskell ALUT package], [2.1.0.1], [sven.panne@aedion.de], [ALUT])+AC_INIT([Haskell ALUT package], [2.1.0.2], [sven.panne@aedion.de], [ALUT])  # Safety check: Ensure that we are in the correct source directory. AC_CONFIG_SRCDIR([include/HsALUT.h.in])
+ examples/Basic/HelloWorld.hs view
@@ -0,0 +1,20 @@+{-+   HelloWorld.hs (adapted from hello_world.c in freealut)+   Copyright (c) Sven Panne 2005 <sven.panne@aedion.de>+   This file is part of the ALUT package & distributed under a BSD-style license+   See the file libraries/ALUT/LICENSE+-}++import Sound.ALUT++-- This is the Haskell version of the 'Hello World' program from the ALUT+-- reference manual.++main :: IO ()+main =+   withProgNameAndArgs runALUT $ \_progName _args -> do+      helloBuffer <- createBuffer HelloWorld+      [helloSource] <- genObjectNames 1+      buffer helloSource $= Just helloBuffer+      play [helloSource]+      sleep 1
+ examples/Basic/OpenALInfo.hs view
@@ -0,0 +1,34 @@+{-+   OpenALInfo.hs (modeled after OpenGL's glxinfo)+   Copyright (c) Sven Panne 2005 <sven.panne@aedion.de>+   This file is part of the ALUT package & distributed under a BSD-style license+   See the file libraries/ALUT/LICENSE+-}++import Text.PrettyPrint+import Sound.ALUT++-- This program prints some basic information about ALC and AL.++printVar :: (a -> Doc) -> GettableStateVar a -> IO ()+printVar format var = get var >>= putStrLn . render . format++printStringVar :: String -> GettableStateVar String -> IO ()+printStringVar header = printVar (\v -> text header <> colon <+> text v)++printStringListVar :: String -> GettableStateVar [String] -> IO ()+printStringListVar header =+   printVar (\xs -> text header <> colon $$+                    nest 4 (fsep (punctuate comma (map text xs))))++main :: IO ()+main =+   withProgNameAndArgs runALUT $ \_progName _args -> do+      Just ctx <- get currentContext+      Just dev <- get (contextsDevice ctx)+      printStringVar "ALC version" alcVersion+      printStringListVar "ALC extensions" (alcExtensions dev)+      printStringVar "AL version" alVersion+      printStringVar "AL renderer" alRenderer+      printStringVar "AL vendor" alVendor+      printStringListVar "AL extensions" alExtensions
+ examples/Basic/PlayFile.hs view
@@ -0,0 +1,51 @@+{-+   PlayFile.hs (adapted from playfile.c in freealut)+   Copyright (c) Sven Panne 2005 <sven.panne@aedion.de>+   This file is part of the ALUT package & distributed under a BSD-style license+   See the file libraries/ALUT/LICENSE+-}++import Control.Monad ( when, unless )+import Data.List ( intersperse )+import Sound.ALUT+import System.Exit ( exitFailure )+import System.IO ( hPutStrLn, stderr )++-- This program loads and plays a variety of files.++playFile :: FilePath -> IO ()+playFile fileName = do+   -- Create an AL buffer from the given sound file.+   buf <- createBuffer (File fileName)++   -- Generate a single source, attach the buffer to it and start playing.+   [source] <- genObjectNames 1+   buffer source $= Just buf+   play [source]++   -- Normally nothing should go wrong above, but one never knows...+   errs <- get alErrors+   unless (null errs) $ do+      hPutStrLn stderr (concat (intersperse "," [ d | ALError _ d <- errs ]))+      exitFailure++   -- Check every 0.1 seconds if the sound is still playing.+   let waitWhilePlaying = do+          sleep 0.1+          state <- get (sourceState source)+          when (state == Playing) $+             waitWhilePlaying+   waitWhilePlaying++main :: IO ()+main = do+   -- Initialise ALUT and eat any ALUT-specific commandline flags.+   withProgNameAndArgs runALUT $ \progName args -> do++      -- Check for correct usage.+      unless (length args == 1) $ do+         hPutStrLn stderr ("usage: " ++ progName ++ " <fileName>")+         exitFailure++      -- If everything is OK, play the sound file and exit when finished.+      playFile (head args)
+ examples/TestSuite/TestErrorStuff.hs view
@@ -0,0 +1,20 @@+{-+   TestErrorStuff.hs (adapted from test_errorstuff.c in freealut)+   Copyright (c) Sven Panne 2005 <sven.panne@aedion.de>+   This file is part of the ALUT package & distributed under a BSD-style license+   See the file libraries/ALUT/LICENSE+-}++import Sound.ALUT+import System.Exit ( exitFailure, exitWith, ExitCode(ExitSuccess) )+import System.IO ( hPutStrLn, stderr )++-- This is a minimal test for error handling.++main :: IO ()+main = do+   withProgNameAndArgs runALUT $ \_progName _args ->+     createBuffer (File "no_such_file_in_existance.wav")+       `catch` const (exitWith ExitSuccess)+   hPutStrLn stderr "expected an I/O error"+   exitFailure
+ examples/TestSuite/TestFileLoader.hs view
@@ -0,0 +1,47 @@+{-+   TestFileLoader.hs (adapted from test_fileloader.c in freealut)+   Copyright (c) Sven Panne 2005 <sven.panne@aedion.de>+   This file is part of the ALUT package & distributed under a BSD-style license+   See the file libraries/ALUT/LICENSE+-}++import Control.Monad ( when, unless )+import Data.List ( intersperse )+import Sound.ALUT+import System.Exit ( exitFailure )+import System.IO ( hPutStrLn, stderr )++-- This program loads and plays a variety of files, basically an automated+-- version of Basic/PlayFile.hs.++playFile :: FilePath -> IO ()+playFile fileName = do+   -- Create an AL buffer from the given sound file.+   buf <- createBuffer (File fileName)++   -- Generate a single source, attach the buffer to it and start playing.+   [source] <- genObjectNames 1+   buffer source $= Just buf+   play [source]++   -- Normally nothing should go wrong above, but one never knows...+   errs <- get alErrors+   unless (null errs) $ do+      hPutStrLn stderr (concat (intersperse "," [ d | ALError _ d <- errs ]))+      exitFailure++   -- Check every 0.1 seconds if the sound is still playing.+   let waitWhilePlaying = do+          sleep 0.1+          state <- get (sourceState source)+          when (state == Playing) $+             waitWhilePlaying+   waitWhilePlaying++main :: IO ()+main =+   -- Initialise ALUT and eat any ALUT-specific commandline flags.+   withProgNameAndArgs runALUT $ \_progName _args -> do++     -- If everything is OK, play the sound files and exit when finished.+     mapM_ playFile [ "file1.wav", "file2.au", "file3.raw" ]
+ examples/TestSuite/TestMemoryLoader.hs view
@@ -0,0 +1,63 @@+{-+   TestMemoryLoader.hs (adapted from test_memoryloader.c in freealut)+   Copyright (c) Sven Panne 2005 <sven.panne@aedion.de>+   This file is part of the ALUT package & distributed under a BSD-style license+   See the file libraries/ALUT/LICENSE+-}++import Control.Exception ( bracket )+import Control.Monad ( when, unless )+import Data.List ( intersperse )+import Foreign.Marshal.Alloc ( allocaBytes )+import Sound.ALUT+import System.Exit ( exitFailure )+import System.IO (+   openBinaryFile, IOMode(ReadMode), hClose, hFileSize, hGetBuf, hPutStrLn,+   stderr )++-- This program loads and plays a variety of files from memory, basically a+-- modified version of TestFileLoader.hs.++withFileContents :: FilePath -> (MemoryRegion a -> IO b) -> IO b+withFileContents filePath action =+   bracket (openBinaryFile filePath ReadMode) hClose $ \handle -> do+      numBytes <- fmap fromIntegral (hFileSize handle)+      allocaBytes numBytes $ \buf -> do+         bytesRead <- hGetBuf handle buf numBytes+         when (bytesRead /= numBytes) $+            ioError (userError "hGetBuf")+         action (MemoryRegion buf (fromIntegral numBytes))++playFile :: FilePath -> IO ()+playFile fileName = do+   -- Load the sound file into memory and create an AL buffer from it.+   buf <- withFileContents fileName (createBuffer . FileImage)++   -- Generate a single source, attach the buffer to it and start playing.+   [source] <- genObjectNames 1+   buffer source $= Just buf+   play [source]++   -- Normally nothing should go wrong above, but one never knows...+   errs <- get alErrors+   unless (null errs) $ do+      hPutStrLn stderr (concat (intersperse "," [ d | ALError _ d <- errs ]))+      exitFailure++   -- Check every 0.1 seconds if the sound is still playing.+   let waitWhilePlaying = do+          sleep 0.1+          state <- get (sourceState source)+          when (state == Playing) $+             waitWhilePlaying+   waitWhilePlaying++main :: IO ()+main =+   -- Initialise ALUT and eat any ALUT-specific commandline flags.+   withProgNameAndArgs runALUT $ \_progName _args -> do++     -- If everything is OK, play the sound files and exit when finished. Note+     -- that we can not play raw sound files from memory because the format+     -- can't be guessed without a file name.+     mapM_ playFile [ "file1.wav", "file2.au" ]
+ examples/TestSuite/TestVersion.hs view
@@ -0,0 +1,23 @@+{-+   TestVersion.hs (adapted from test_version.c in freealut)+   Copyright (c) Sven Panne 2005 <sven.panne@aedion.de>+   This file is part of the ALUT package & distributed under a BSD-style license+   See the file libraries/ALUT/LICENSE+-}++import Control.Monad ( unless )+import Sound.ALUT+import System.Exit ( exitFailure )+import System.IO ( hPutStrLn, stderr )++-- This program checks that the version of OpenAL in the library agrees with the+-- header file we're compiled against.++main :: IO ()+main =+   withProgNameAndArgs runALUT $ \_progName _args -> do+      av <- get alutVersion+      unless (av == alutAPIVersion) $ do+         hPutStrLn stderr ("WARNING: The ALUT library is version " ++ av ++ ".x but the ALUT binding says it's " ++ alutAPIVersion ++ ".x!")+         exitFailure+      hPutStrLn stderr ("The ALUT library is at version " ++ av ++ ".x")
+ examples/TestSuite/TestWaveforms.hs view
@@ -0,0 +1,23 @@+{-+   TestWaveforms.hs (adapted from test_waveforms.c in freealut)+   Copyright (c) Sven Panne 2005 <sven.panne@aedion.de>+   This file is part of the ALUT package & distributed under a BSD-style license+   See the file libraries/ALUT/LICENSE+-}++import Sound.ALUT++-- This program plays a 440Hz tone using a variety of waveforms.++playTone :: (Frequency -> Phase -> Duration -> SoundDataSource a) -> IO ()+playTone soundDataSource = do+   buf <- createBuffer (soundDataSource 440 0 1)+   [source] <- genObjectNames 1+   buffer source $= Just buf+   play [source]+   sleep 1++main :: IO ()+main =+   withProgNameAndArgs runALUT $ \_progName _args ->+      mapM_ playTone [ Sine, Square, Sawtooth, (const (const WhiteNoise)), Impulse ]
+ examples/TestSuite/file1.wav view

binary file changed (absent → 6246 bytes)

+ examples/TestSuite/file2.au view

binary file changed (absent → 6400 bytes)

+ examples/TestSuite/file3.raw view
@@ -0,0 +1,1 @@+~~~€‚€€~~€€€€€~€~€€€€€€‚€}~€‚ƒ‚ƒ~||„„„€‚€}y|ƒŠ†‚~||}z{‡ŒŒ€zy€ƒsn{•“xip…Ž{wmƒ‘ˆwŠ„xˆ‡h„Š“‹wz|}Œ€…‡†ik~“{px|…‡~‡‡‚ot„‹€w}{†|‹„vjnŒwu}{†|‚ŠpoŠˆwx{ƒŠ†‹ƒwl‚‹‡xt}|…|ˆ€|ymŠ‹Œt||‡…Š}~xtˆ”‘†n{w~„‰ywjx‘„t}|€„‚Š}qp“†‡uw}€ƒƒ€…jx’€—}„}…„ށsnn’€r}~ƒ‚}ƒ€€|w‹…ƒ}x€~ƒ€{}†r‡ˆŠw‰zŒ†}~so~–‡‹p€ƒ„€€u{y‰€|}y‚ˆ€€„„rrˆ~„ptˆ†xry”yŒ|ƒ„ˆ…}|‚„}t‚€‚{x…‡w|~}q~Œv~jz†…‹p}r}’€|yƒ‡‚‚ƒƒmx}‚prˆ„Žtu€r„™y‰m‡‡‰v„m›t{o†||y{Œ|xt‘uxy‹Ž€|t‡vr›x„mu„€‰p}‚„˜{r†…}„{‡{t–y{r{І†y|wŒ †osŠ~xu{zz‚€q}‡ƒ†~€vrƒŽ~k}†‰ƒv‚v”–}€pˆƒ€}x…uw‰x‚vˆ‚uz}u˜‰vzm€‚Šwy{•‰sƒŠ†}w|„v”Œ|~y†‚‚€ws„‰„kqƒ‡xtŽp‹…yt€Š‰{w|ŒŠ}n„ŠŒvs€v—†~utz„ˆ‚„z†}n…ŠŽxp€„„z‘†zs†‹„|xtŠz‡…|x{z‚sz”…my‚ˆ…pz’zpz„„oz†€xu‘Œus…†‰zx~–‘{yq†Œ†{pƒ††p„…‚„r„„‚}sw•‚{ls”„ny„y{Š~‰rv|„Š|~yˆŽƒuqŠ“‰unzˆz‹ƒzqvƒ†€ˆuy†…~t}…wq~†v†“ƒq~„‡ƒxy”{v}„Š~u~‚‚tw“†|t{†ƒ€z€z–‡zt†ˆŠzt…ƒw†‚ƒvz€ˆ|v†‰~yrƒ‘†zt}†y‹†‚qz„†‚yy‹…~rx‹‡o†s~•}‚q~‹vx‡Œ}px~ކ}rz„xv‰‰{tw‰‹€pt—Ž}wu{އvt}‰‚tŒŠ€~v†††{vx„—~xt„€{sƒw‹‚tp€ŠŒ|r~€†‡vy„~t~‚‚{Š„|wx€Š‡~ovŒ…xv„‹v{†‹zn~yt}†‰vtwŒ˜†ur”†yt|x~„sz}…Š€|t†‰‡vr…pv‚{†’ˆwpx†ˆztˆ’†wt‚”Žwow‹~}“|wsˆ…|x|“‘wrxŽ”pp††w}Š‚yt{†xyx}‹{~†{y}€€s‰”†ym€…ˆxz‚|vˆˆwr€Šƒvx}w‡‡€|u€Šˆ‚ry‹…zv„Ž„xz}ˆws“~rwЇƒx|u–‹wvy‰ˆ„vy‡y~‹ˆ}z{„‰€zwx€vvyŒ‘|u}ˆ‚Œ†{p}‚‰…~}u‰ˆ€uАr~‚…•ƒ€r|€…‡v‰Ž|pv’“zp€‰„uˆ–|yw†‡…|r‰|zz„Œ„xw……zu……z{xƒ††|n‰“†xqv’{pzzyŠ‚‰puy‹Ž…ss“‡pt‚ƒmy‚zyŽŠxou‹Š„zw…ކ{pvŠvr‡|tŽzsr†‰wv}xxzƒˆ€{wƒ‚~{ˆŠ|sy€‰ˆ~{|z†Šƒ‚}|‚y|sŒ†|ww‡…€z‚‚x{…„}vƒ‹ƒ}w~…’ˆuu‰‚xp†•‹wr‚„‡€}z}†wt€Œ|{z‚~€|v{Žzyx|‡‚ˆx€psˆˆ‡~u}‡‡„ss‘‚{{x‹ƒsv††ƒ|ˆ‹~r~Œ‹}{{{‰‚|x€„‚„€€}t…’ˆ‚u~|ƒ‚|~~•zxt|‡~y|}y|†pyƒŠ…~r~Œ€wx„†€„~z{„zw|ˆŒx|v€—xz{{„Іzxt~ƒvuxŠŽ‰sr„‡‚t„‚yxƒ…‚€{tˆ‡ywxˆ}t|€€’†‰yvwƒ†€}|’}yvy‹’ƒvy…}wŠ„qq~‰†~uu’†}sx„‹tx€‚zy…~rs…ˆŠ}vŠ}zv}wv‚{x’Œ}sr„І{~}‚„~w}†}s|…€{†„vv{‰Œpt‰…{u|‚Œ‡}u€ƒvu’~zrz‰‰wyqŽ‘zz|‰Œtz€~„Žzpt‰ˆ€{yzxŠƒyp†‡ˆwtx€’~€y{Š‚{€‚€{…Š€v~{€‹‚v}z}‘Žvz€ƒx‰„~wxz……uu~zx‡Œ‚vt~……~v‘Œ}xs{‰‹{tx~v}Žyrs„†€y…Ž‚}|u‘|stƒ€wŽ€vp~†‡~‚|…ƒ}}{ƒ“vn„‰{‡’‚}r~‚†€|{’wtx„‚†z{~‚w~zv„‰~y}v}{u}ƒƒ‚|‚|x‹‰€y{Šƒst~x‰—‚t{}Š„t†ˆ}vx~…‚tw~{w„ƒvqz……ƒ|v”ˆ|vv„‚‚‚€y{{’†z|…†w{r‹–}v€ƒ…~zw‡•|xw|ˆ„|z}yw„‹‡€oy‰‰…}tyŒxr|”„yr€ƒw}ˆpvˆŒ‡}uy…xuv”‚p{ƒy…tr‚Š‹~qpˆ|w|‚~‚}|‚‹~z€ƒƒ}}w~Ž~yv|ˆ„‚~‡‚pw†ŒutzŽŠƒw|u{†~w}„†r|’yw~…ƒ~~€|y‰‚y|†}|€|‘|v|…ˆ{vz‹„|z|~„††}}|yt’€}sy‚‡~uˆ“„vƒ€|~…zv‰|xvƒzr}~so~„‰|~ˆwux‘}to†‚€„{qz„†ƒ~u~zx|„ƒ‚~|‚~}Œ~w}…ƒ}}w„’†€|{‹‹x{~v‹”Šxqt„‡ƒ}wƒŒ}r‡•vq€…x‡Šypy„€x†˜ˆrr„……„~x{~|yŽ~yu€ˆ}yyx‚Žy{x|‡}ƒ|ut„tsŽ†rs||„‰……vuy‡†zx~}wy…ŽŠxuyx“‡ytx€„…„sy‡€}w}”‚xo~„}’ށro†…w“stƒ…Ёxu…wvЉ€tt‚ˆ„}uz‹€{x~‰€}~€zz}‰{x€Š„{}y‹”‚€wz†}x†•yq‚‹…~t|ƒ‚{ˆ…uv{†……s…’‡|y}Ž‹}uy~wŒ‡tsy‡Š{||‰†~z|}}tw„€w‡’…wn~‰‡zt{Œyvƒˆƒ||€†}x€Š~z|†€|~|t”Œ|xx„„ƒ}w„’‰{wy„†„||‚}|‚}|~†„qsˆ‡zx{†…|y…‰ywŒŒsxŒ„{z}x‚Ž…„vyy‰ƒ‚n}Œ}vz‚†…}z}z‡ˆƒu{€‚‚{}Œ†€{{‡…yv€utˆƒwv}„†|‹‰|y}{‹‡|t~€}…~s|†‹~x{ˆzvy‡„~‚ƒ€}|xu–„xtˆ~t{~ˆ”„~{|€†ƒ~yz†…ƒzz€ƒƒ~|sŠ€xz€ƒ†{|zy€Ž„yu‡‰~zy‚„‡ƒz||……|tv•†}uxˆ‡ƒxz{…Œ‚€}x}Žu‚„„szˆqz„‡~tz‹‚{z|~€ƒ‚‚xuzŽˆvtvŒsyx‘…yzwІ}v‰˜vs‚…‚…u{„ƒz……ys‡Š„u{{’uz{…‡ƒ}„ƒp‘†qsŒ’Štt€|xŠstz‡‡}~{…ƒwz€Œywxƒ€z‹“|ss‚‡‚‚€{vzŠ„||x‡†ƒw|vwŒˆ„x|€‚€}~~Ž|x€€}ˆ€t}†|x‹—‚st†ˆ„{{w”ˆwx|…€~„xxŒ‚t|‰|x|€w†‰~sz‚‡~y{‹„yq€†…„xz€‚„z‰‹y{x…‚|t…“|zx€‡‡~u~|‡’„|sz€ƒ‚€~||}z’‡{uy‡„}z}v–€~uy…‡…|z|„Ž€|xx‡w}ƒ‰wt…Ž}py‡Š|u}x“Œ}{{€€~~~y€ˆƒ{|€z~ƒ„p{{v}ƒˆ}€ƒu‰Ž‰{r|†wˆ…wx|€Œƒxr€„†|z…{w}‚}~|}ˆ~}{~…„€~y…‹ˆy{€‚€€|z€‹€zu{ˆ~u…}ŽŒzxy…„y|€…’…zt…„ƒ}{‚ˆ}ˆ…x€„€x€{|}xuyˆ‡„uz~Œ~wv~~‡zv~‡{„•‹sr{†„}t“‹|uyŒŠ†vz‚|sŒ–‰qt}‰…zy‹~v{ƒ…‹‡yx|‡}x‹”€qq†…~ˆ‚|x…ˆ~}{€‚‚ƒ‡v‡}y…‡ƒ~xvŠ“yvy†ˆw}y€Žz{{ƒ„}‚~‚x‚І~xz‚‡}~x‡Žyt}„‰|{ˆyxy‰†~}~}~€‡‰wz…‚z~€‚x‰“…xux‡‡zyy…Šxw~€€‰€y{„{y€u}„}|…}q”‹yusА‰qy€p…}v~ƒ‚†‚v‹†t}Šƒ|}„y‡†ww~‡~{†“ysw‡†‚~}|~„‚„yƒ€{zƒ…‚|ƒ{•~yq‚…ƒ|}„y|……z{|…Š„s|xv’Œƒpv‚…„|ty‚vx}‚{}|€~„†|‚‡yyƒƒwr—†tt}†ˆzz|z†ˆƒzyƒ‡‚~|‚ƒ{€…ˆxx{„ˆ„{s|Œy|€„…}~xyŽ”‡ps‡…ƒ~}|w|„yy„{v‹•‰qr„‰„{w}‚wx‚ƒ‚|~€{}~~€ƒt|yx}ˆ€„s„txƒ‡ƒ‚~€~…‡z{ƒ‚{~€ƒ~s~‘‚vu€…€y{“‡t|€~ƒ‚ƒ|||}{†~x{}‰t‚~u•ˆ€vs„ŠŒwwx…€zu€…~ƒtu€„rx€‡ƒ~‚‘Œ|{wˆ‚zw„{{€~yxw‘p{†zr”ƒst…ˆƒ~€t’yvz…€‚„|}w…ŒŒwu„‡€‚|t–…ru|……€}v‡‘„vz‚|„„|{‚|t‚}zu}ˆ‚|t}Š|xx€~~‚u~‹ˆ~ux{‰~z|†yp”‰rs|†€~yއ|~|„€‚vzˆ~v‡‹}y…}uƒŒ‚~v‚‡‚y{|†z}€‚„{y}€…„zz†~|~…‚y{s…Š|xu€‡„}{{{Œ’}xx~…ˆ|zƒ‚}|z‚‘s{ƒ…z|sŽxy}ˆ{‚rz‡ztz…ƒ‡€|{~€|‰}v{…ˆ}€|s‡‡zxzƒ‡„~zyŽ‚wz„€~zƒˆ€‡‚z|†ƒw{z”‡wuzˆƒ|uˆ{y€‚…€~~~ƒz‡‹yyxŒ‚{€~|Ž’yx|ˆŠ‚{xy}Ž„zz}…€ƒ|~{‡}}|ƒ…ysx…yu{†‡„|yv|‘…wy|„…||ƒzyˆƒ|x}‚{vy~wv~ˆ†}zw‰Ž‡vw|‰‚u‚€~z…zt€†€€pyŽ~wt}‹‹‚yvy‹Œ‡xu|‡…€{x‰„}xwŠ†vwƒwqŽŠtu‚…„yy‹€xy‚‚‚ƒ{€|…‚|‡‚|}~†}z{w’†}wz‚€}x‹†t}~~‰ƒtˆtx‰‰vx‚‡…}~v‚…y{{ƒƒ…z}xƒ~x{…‡„}|€…yxˆ„tv}…‡rŽŠyy‰„„zz{}‡†‚tv€†…~|vu…†qs|‹x{€‡}zy‚€€z|yŠ‹ts„Šˆ||‚{pŽ”‰urƒŒ‰x{€€}{|ƒ€‡z{€|€‚Œyxƒ„€}x†“x{z€‡ƒyx~„€x}ƒ‚†ƒ|z‚{†sv€„‚}~‡q€‰}|t{Љs~„r„‡wq}…ˆ„€|w‚‰}ty‡…}y|~€„‡{z}„…}zˆ”†wxz‚ƒ„~z{{†„Šxx……|~yŠƒzs€…Œ{u}ƒ€…zvu‡~xu‚€u”{sq„‰‹}yt‘~zx€„ƒ‡‚y{~ƒƒ|ŠŒw~~€„„‚t‰–x{w…ˆƒ|{€~‚|tsƒ†‚|}}|ˆ‚xxu…‰€xz‚‚|vŠ’ˆrx‡†€|}x‹Š€{wƒ„…}~~ƒƒuy‹ƒzy‚ˆ~v{–tsxˆ‡yy}Œ‹‚y~‚‚€|€}‚‰‹{mxƒuz‚ƒs‰”ztu†…{~u„“|{~~‡„|}„ˆ…wy}Œ|x„‡pŠ€zu€†‚|uˆ‚{{}…‚‚~}{~€‹uw}Žwszˆ„ryŒƒvu~ˆzy{wŽ~yy{…ƒ€z{z†Š‚|zyІ|tƒ‡zyŒ…{s|‚†‚||x†ƒ}~‚€|x†‡ys……‚|{‚v„vy€ˆƒyw~|Œ€}y}…‚‚€}}€}€Š‚x}ƒˆy}ƒw~Œ„uzŠ‡{wx‡„{}~‚~ƒ{~€‡~~{|…„}{€ƒv‚Ž~{u|„‰ƒvzw‰{|‚„}{ƒ‚~€}t…{|wx•xu{‰ˆ†xxzw|}„†z|~ƒ†{€†~{yŠ…ƒz{|Ž–ww{†Œ…xr~xŽ„vty†‡|~z~Š„xw‰}zx†„wvˆŽ|q|„„€zy{……~z}‚„€ƒ}y|€p…„}~€||uˆvv‚…†€yy{‰…‚}zy†‹~wx‚‚y|‚‰€v~‡~~„su“†|tvˆŒ‡u|yzˆ‹„uw„‚…€x~‹u†~„‚zu{’{w}ƒƒ…~{‡†zz}Љvt|…„x…}tŒŠ}xzx‚Œ|v|†‡ƒu{}‹ƒ|v€‚„~‚‚{qސtuŠ’Šyxy{|„ŒŽwsw……yw‹„ty…„~€€~ƒ„|‚ˆzyƒ‡z~zŠ‘{xx„……€yy{‰„|x~ƒ†…~~{€yŠ“‹uu|ˆ€‚{‹}|{ˆ…€z}€~Љˆvyz}‚wu…~w‚“tx‚Š„}zt€‰|}{€€~|~‰„}v†Ž{{‚‚€uŒƒzu€ˆƒz|xy‘„~w„€€€|yˆŒxtw„|}v‚‘‡|s|†‡€xy€{z~‚~~}…„vƒŒzs€ˆ‡|{}{†‘Švuwˆ†€{|z‰{|~{ˆ‚~{~z€|‰Žvw†…‚~|{wy€…‚ƒxx€Žƒ}y{ƒ…~||v‰Œƒ~€|€„‚€}sy†xu{‹‰„u{xx‰‰‚yw€ƒ†„|ƒx~ІzwŠŽ{v€‚}xŒ”v{ƒ‡„~wxƒ‰w{…€€€ƒ„yy…{}„‡~}|vu…‹vz‚ˆ„|}xy…}yz€ƒ„~~z‰Žwp‚‰Š}z}tŽ•†xty††}w‚‹zvƒ†€€€ƒ}|…ƒtz†ƒ}†~{w~Ž…ws€‰‡}|zxށz|~~ƒ€|u†‹‡z{~ƒ‡€{|vzŒ†}vz€‡„{|yˆŽ„|{}€ƒƒy†ˆyt€…ƒ{‚ˆ~zv‚Ž–vv~„ˆ}xz}‹‚}x|ƒ‡|{zƒ|……{v„†…z~uƒŽ{ww|‡†‚|{}xŠŒ|qz‚ƒ„‚{~|€…‰€wu‰vyƒy‡vr‡€zy~yx€‡ƒ„|~y~‚Šƒr‡ƒ}y…‚q|”…vx‚†|}€yŽ‘ƒ{x€ƒ~~yzŒ…~xywxsyˆy‚~vv…†{|x}Ž{z„‚‚~~y…„yr}Œ}u†y|‰xuŠƒ~v{xˆ|z~€ƒ…~}~~}~Їvy‚‡ƒ~z}~vyv††ƒ{~{€Š‚€y|„}}|ƒ„{}ƒ€€z~‚€||Œwr€…†~v‚…z€…|uzƒˆƒ{x{|ƒ~xx‰‹†ww|††t|vx„‡~{u‚Œ~ux‚…~{~~yŒƒ}ww|‹|s~‚‚zˆŽŒwt{„ƒ}}‚vƒ|y|…†~~~ƒyƒvuyŒˆ~v}ƒxxxy‚‚~„€x‹w~„€y‡‹„~s„†ƒ}~}|zŒˆ‚wzz€‡‚~€}ˆ††~x{€Šz}€€‚‚†z‚ƒ€~€zwŒ†|x~‚…†{ƒ‡~v„ƒ~~…€~Љwv{Š€u~„‚tu’ƒrt†€€~v~‰…€zz}†…ƒ}|}x€‡†…t{††€‚~{‚ސ{vwˆƒ}x}|x‡}vv‚ƒƒƒz{u‡‘ŒytzŠŠyy‚~vu~‘‡vz€‚„‚}u|‡ƒ‚{||ƒ~‚‚}v„‡~~€}‚€}~vz‹†€w€|‡ƒz|xuŒŠwv{ˆ……w{}z~ŒŽˆtr€‰Œxv€~‰Š‡~ww{ˆ‹‰{ww|}†Œ€ys|„‹‰~zu€y‚vt|†…ˆ}zz€zz‰‹ˆ|tzz†‰ˆ|yy€y€‡uqy|††‹~xz€yyƒŽ†„p|}‰‰‡‚x{||y|’Іuz€‚‡Š…zx}‚‚t…‘Œs{|ˆƒ~…„yu|y‹ˆ…{u}}}‚Š„~wz€|„މ~uy€‡€|ƒ…{{}~„ˆ…z|~ƒ€ˆ~}~€~|vŒ‡‡y{€~}‚…„}||~€‹‡„|€~}~‚ƒƒ„x}€~~t~‰†‰}x{€ƒ„†ƒƒ{|}}…zs…ˆ†‚~|z|‚„‡}|z|‚†…us…„ˆ†„€||z~‚†„€~~€~€~}€…‚}~}‡€€…xw€ƒ†~‚€~€„€{€|ƒƒ€‚€yx}ƒ„}}~~~~‚†‡€|yv~‰ŒŠ|}|}ƒ…ƒ|{€‚}~‚ƒ}|}|‚„„†€‚‚€|{}ƒ‚…‚zz}ƒ„~|x€…†Š„~}}z|z‚„‹„€~~}|{}„ˆ„€|‚}~}€‚„€~€€}€ƒyz~‚€{‚‚‚~‚‚€~~}}€‚‚‚‚‚|{‚€€ƒ}z|}€ƒ†ƒ|}€€€~}„ƒ‚~{€‚€~x|„ƒƒ‚‚€~}~‡„~‚ƒ|y|‚ƒ‚~€‚ƒ€~~€€€€€}€~}„‚}{~ƒ‚€€„|}€€}‚†}}}~~€ƒ€~|‚†ƒ{}‚‚€}~€}†ƒ€|}}…„‚€~||~„„„€}|~‚‚‚‚‚ƒ|{€€€…‚€}}€~€~ƒ€ƒ„€€}~~€…„€|{„‚~}ƒ~~||}„~€€~‚ƒ‚||~„€}€€€€~€€‚}~€„~€‚€|{„}~€€€€‚|}€‚~„‚€€|‚ƒƒ€|~‚‚}}‚ƒ~}€€}|€€€‚~|~‚~€€}~~€ƒƒ~€~€€€~„~}}ƒƒ}‚€ƒ€|‚ƒƒ‚~~}~‚€‚‚‚~}|~„ƒ~€€€~}‚‚‚€}€‚‚~~€‚}€€€€‚€~}~~ƒ‚€‚}||€ƒ‚~€}~‚€~„~}€€||‚‚‚~~|„„€ƒ‚~}‚‚€‚„}{~…ƒ‚|}†}~€ƒ€}€€€‚ƒ~||€„€{€‚~~€€€€€~‚}}z‚~ƒ~|€‚‚~€€}~ƒ…{{~}€‚€‚‚~~}€‚~€€€€€€€€€€~€€€€€€€€€€€€€€~€€€€€€€€€€€€€€€€€€€€€€€€€€