Play recorded sounds: Difference between revisions

Content added Content deleted
Line 129: Line 129:
dwVol as long, ret as long
dwVol as long, ret as long
</lang>
</lang>

=={{header|Mathematica}}==
This code demonstrates :
loading two prerecorded sounds,playing them individually then simultaneously,
stopping before the end of the sound,looping (preferably glitch-free)and setting the volume of each sound

<lang Mathematica>a = Import["sound1.flac","FLAC"]; b = Import["sound2.flac","FLAC"];

ListPlay[a, {t, 0, 10}]; ListPlay[b, {t, 0, 10}];

ListPlay[{a,b}, {t, 0, 10}];

Stopping before the end can be done using the GUI or by reducing the parameter range of the ListPlay function.

While[True,ListPlay[{a,b}, {t, 0, 10}];]

ListPlay[{0.5*a, 0.3*b}, {t, 0, 10}];</lang>

-Supported audio formats :
AIFF Macintosh sound format (.aif, .aiff),
AU Mu law encoding Unix Audio Format (.au),
FLAC lossless audio codec (.flac),
SND file format, equivalent to AU (.snd),
"WAV" WAV format (.wav),
"Wave64" Sony Wave64 format (.w64),
MIDI format (.mid)

-Suitability for game sound effects :
low-latency start : yes
resource efficiency : low
support for many simultaneous sounds : yes

-Suitable for playing sound of arbitrary long duration.



=={{header|PicoLisp}}==
=={{header|PicoLisp}}==