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
e6392c0b
Commit
e6392c0b
authored
Sep 05, 2020
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add hello world example for engine.
parent
acf4284a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
research/_examples/engine_hello_world.c
research/_examples/engine_hello_world.c
+34
-0
No files found.
research/_examples/engine_hello_world.c
0 → 100644
View file @
e6392c0b
/*
This example demonstrates how to initialize an audio engine and play a sound.
This will play the sound specified on the command line.
*/
#define MINIAUDIO_IMPLEMENTATION
#include "../../miniaudio.h"
#include "../miniaudio_engine.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
;
}
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