You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SoLoud package comes with a few simple examples. These can be found under the 'demos' directory. Pre-built binaries for Windows can also be found in the 'bin' directory.
5
+
6
+
simplest
7
+
--------
8
+
9
+
The simplest example initializes SoLoud with winmm (for windows) or portaudio (otherwise), and uses the speech synthesizer to play some sound. Once the sound has finished, the application cleans up and quits.
10
+
11
+
This example also uses SoLoud's cross-platform thread library to sleep while waiting for the sound to end.
12
+
13
+
multimusic
14
+
----------
15
+
16
+
The multimusic example loads two OGG music loops as well as one sound effect. You can use the keyboard keys 1 through 5 for various effects:
17
+
18
+
Key Effect
19
+
----- --------
20
+
1 Play sound effect at random play speed and pan
21
+
2 Fade music 1 in and music 2 out
22
+
3 Fade music 2 in and music 1 out
23
+
4 Fade music relative play speed way down
24
+
5 Fade music relative play speed to normal
25
+
26
+
piano
27
+
-----
28
+
29
+
This example is a simple implementation of a playable instrument. The example also includes a simple waveform generator (soloud_basicwave.cpp/h), which can produce square, saw, sine and triangle waves. If compiled to use portmidi, you can also use a midi keyboard to drive the example.
30
+
31
+
The 1234.. and qwer.. rows of your keyboard can be used to play notes. asdf.. row selects waveform, and zxcv.. row selects filters. Speech synthesizer and on-screen text describes what different keys do. Have fun experimenting!
32
+
33
+
mixbusses
34
+
---------
35
+
36
+
The mixbusses example demonstrates the use of mixing busses. You can use "qw", "as" and "zx" keys to adjust volume of different busses.
37
+
38
+
env
39
+
---
40
+
41
+
The env demo is a non-interactive demo of how SoLoud could be used to play environmental audio.
SoLoud comes with a premake4 script. If you want to build SoLoud as static library, instead of including the source files in your project, this can be handy.
5
+
6
+
Premake can be downloaded from <http://industriousone.com/premake>.
7
+
8
+
Unfortunately, premake4 cannot magically figure out where your libraries may be installed, so you may have to edit the premake4.lua file. The lines to edit can be found at the very beginning of the file, with the following defaults:
9
+
10
+
local sdl_root = "/libraries/sdl"
11
+
local portmidi_root = "/libraries/portmidi"
12
+
local dxsdk_root = "C:/Program Files (x86)/Microsoft ..."
13
+
local portaudio_root = "/libraries/portaudio"
14
+
local openal_root = "/libraries/openal"
15
+
16
+
You will most likely want to edit at least the sdl_root variable. After your edits, you can run premake4 to generate makefiles or the IDE project files of your preference, such as:
17
+
18
+
premake4 vs2010
19
+
20
+
The current version (4.3) supports codeblocks, codelite, vs2002, vs2003, vs2005, vs2008, vs2010, xcode3 and gnu makefiles (gmake). New version with at least vs2012 support is coming soon (as of this writing).
21
+
22
+
If you wish to use portmidi with the piano example, run premake with an additional parameter:
0 commit comments