Skip to content

Commit 0f13426

Browse files
committed
Demo
1 parent 986f4bf commit 0f13426

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

data/LICENSE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Copyright (C) 2021 Timur Gafarov.
2+
`music.flac` is available under Creative Commons Attribution ShareAlike 4.0.
3+
If you create a derivative work based on `music.flac`, please, provide this file with it or include it in the documentation.

data/music.flac

1.8 MB
Binary file not shown.

demo/main.d

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module main;
2+
3+
import soloud;
4+
5+
void main()
6+
{
7+
loadSoloud();
8+
9+
Soloud soloud = Soloud.create();
10+
soloud.init();
11+
12+
WavStream music = WavStream.create();
13+
music.load("data/music.flac");
14+
int voice = soloud.play(music);
15+
16+
while (soloud.getActiveVoiceCount() > 0)
17+
{
18+
// do nothing while music is playing...
19+
}
20+
21+
music.free();
22+
soloud.deinit();
23+
}

dub.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
{
2323
"name": "library",
2424
"targetType": "library"
25+
},
26+
{
27+
"name": "application",
28+
"targetName": "demo",
29+
"targetType": "executable",
30+
"mainSourceFile": "demo/main.d"
2531
}
2632
],
2733

0 commit comments

Comments
 (0)