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
ac158cd0
Commit
ac158cd0
authored
Jun 24, 2017
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add early support for OSS.
parent
c15dcfb8
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
371 additions
and
38 deletions
+371
-38
examples/simple_enumeration.c
examples/simple_enumeration.c
+58
-0
examples/simple_playback.c
examples/simple_playback.c
+2
-1
mini_al.h
mini_al.h
+311
-37
No files found.
examples/simple_enumeration.c
0 → 100644
View file @
ac158cd0
#define MAL_IMPLEMENTATION
#include "../mini_al.h"
#define DR_WAV_IMPLEMENTATION
#include "dr_wav.h"
#include <stdio.h>
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
<
2
)
{
printf
(
"No input file."
);
return
-
1
;
}
mal_context
context
;
if
(
mal_context_init
(
NULL
,
0
,
&
context
)
!=
MAL_SUCCESS
)
{
printf
(
"Failed to initialize context."
);
return
-
2
;
}
mal_device_info
infos
[
32
];
mal_uint32
infoCount
=
sizeof
(
infos
)
/
sizeof
(
infos
[
0
]);
// Playback devices.
mal_result
result
=
mal_enumerate_devices
(
&
context
,
mal_device_type_playback
,
&
infoCount
,
infos
);
if
(
result
!=
MAL_SUCCESS
)
{
printf
(
"Failed to enumerate playback devices."
);
mal_context_uninit
(
&
context
);
return
-
3
;
}
printf
(
"Playback Devices
\n
"
);
for
(
mal_uint32
iDevice
=
0
;
iDevice
<
infoCount
;
++
iDevice
)
{
printf
(
" %u: %s
\n
"
,
iDevice
,
infos
[
iDevice
].
name
);
}
printf
(
"
\n
"
);
// Capture devices.
result
=
mal_enumerate_devices
(
&
context
,
mal_device_type_capture
,
&
infoCount
,
infos
);
if
(
result
!=
MAL_SUCCESS
)
{
printf
(
"Failed to enumerate capture devices."
);
mal_context_uninit
(
&
context
);
return
-
4
;
}
printf
(
"Capture Devices
\n
"
);
for
(
mal_uint32
iDevice
=
0
;
iDevice
<
infoCount
;
++
iDevice
)
{
printf
(
" %u: %s
\n
"
,
iDevice
,
infos
[
iDevice
].
name
);
}
mal_context_uninit
(
&
context
);
return
0
;
}
examples/simple_playback.c
View file @
ac158cd0
...
@@ -33,6 +33,7 @@ int main(int argc, char** argv)
...
@@ -33,6 +33,7 @@ int main(int argc, char** argv)
mal_context
context
;
mal_context
context
;
if
(
mal_context_init
(
NULL
,
0
,
&
context
)
!=
MAL_SUCCESS
)
{
if
(
mal_context_init
(
NULL
,
0
,
&
context
)
!=
MAL_SUCCESS
)
{
printf
(
"Failed to initialize context."
);
printf
(
"Failed to initialize context."
);
drwav_uninit
(
&
wav
);
return
-
3
;
return
-
3
;
}
}
...
@@ -55,4 +56,4 @@ int main(int argc, char** argv)
...
@@ -55,4 +56,4 @@ int main(int argc, char** argv)
drwav_uninit
(
&
wav
);
drwav_uninit
(
&
wav
);
return
0
;
return
0
;
}
}
\ No newline at end of file
mini_al.h
View file @
ac158cd0
This diff is collapsed.
Click to expand it.
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