Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
76dcdf77
Commit
76dcdf77
authored
Dec 24, 2021
by
Dylan Perks
Committed by
GitHub
Dec 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reorder examples in README
parent
c9a4f21e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
35 deletions
+36
-35
README.md
README.md
+36
-35
No files found.
README.md
View file @
76dcdf77
...
...
@@ -22,6 +22,42 @@
Examples
========
This example shows one way to play a sound using the high level API.
```
c
#define MINIAUDIO_IMPLEMENTATION
#include "../miniaudio.h"
#include <stdio.h>
int
main
(
int
argc
,
char
**
argv
)
{
ma_result
result
;
ma_engine
engine
;
if
(
argc
<
2
)
{
printf
(
"No input file."
);
return
-
1
;
}
result
=
ma_engine_init
(
NULL
,
&
engine
);
if
(
result
!=
MA_SUCCESS
)
{
printf
(
"Failed to initialize audio engine."
);
return
-
1
;
}
ma_engine_play_sound
(
&
engine
,
argv
[
1
],
NULL
);
printf
(
"Press Enter to quit..."
);
getchar
();
ma_engine_uninit
(
&
engine
);
return
0
;
}
```
This example shows how to decode and play a sound using the low level API.
```
c
...
...
@@ -89,41 +125,6 @@ int main(int argc, char** argv)
}
```
This example shows one way to play a sound using the high level API.
```
c
#define MINIAUDIO_IMPLEMENTATION
#include "../miniaudio.h"
#include <stdio.h>
int
main
(
int
argc
,
char
**
argv
)
{
ma_result
result
;
ma_engine
engine
;
if
(
argc
<
2
)
{
printf
(
"No input file."
);
return
-
1
;
}
result
=
ma_engine_init
(
NULL
,
&
engine
);
if
(
result
!=
MA_SUCCESS
)
{
printf
(
"Failed to initialize audio engine."
);
return
-
1
;
}
ma_engine_play_sound
(
&
engine
,
argv
[
1
],
NULL
);
printf
(
"Press Enter to quit..."
);
getchar
();
ma_engine_uninit
(
&
engine
);
return
0
;
}
```
More examples can be found in the
[
examples
](
examples
)
folder or online here: https://miniaud.io/docs/examples/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment