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
9d461f6d
Commit
9d461f6d
authored
Aug 27, 2023
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor changes to osaudio.
parent
6539b671
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
extras/osaudio/osaudio.h
extras/osaudio/osaudio.h
+13
-2
extras/osaudio/osaudio_miniaudio.c
extras/osaudio/osaudio_miniaudio.c
+3
-1
No files found.
extras/osaudio/osaudio.h
View file @
9d461f6d
...
@@ -240,6 +240,17 @@ I'm looking for feedback on the following:
...
@@ -240,6 +240,17 @@ I'm looking for feedback on the following:
extern
"C"
{
extern
"C"
{
#endif
#endif
/*
Support far pointers on relevant platforms (DOS, in particular). The version of this file
distributed with an operating system wouldn't need this because they would just have an
OS-specific version of this file, but as a reference it's useful to use far pointers here.
*/
#if defined(__MSDOS__) || defined(_MSDOS) || defined(__DOS__)
#define OSAUDIO_FAR far
#else
#define OSAUDIO_FAR
#endif
typedef
struct
_osaudio_t
*
osaudio_t
;
typedef
struct
_osaudio_t
*
osaudio_t
;
typedef
struct
osaudio_config_t
osaudio_config_t
;
typedef
struct
osaudio_config_t
osaudio_config_t
;
typedef
struct
osaudio_id_t
osaudio_id_t
;
typedef
struct
osaudio_id_t
osaudio_id_t
;
...
@@ -508,7 +519,7 @@ Use osaudio_get_avail() to determine how much data can be written without blocki
...
@@ -508,7 +519,7 @@ Use osaudio_get_avail() to determine how much data can be written without blocki
Returns 0 on success, < 0 on failure.
Returns 0 on success, < 0 on failure.
*/
*/
osaudio_result_t
osaudio_write
(
osaudio_t
audio
,
const
void
*
data
,
unsigned
int
frame_count
);
osaudio_result_t
osaudio_write
(
osaudio_t
audio
,
const
void
OSAUDIO_FAR
*
data
,
unsigned
int
frame_count
);
/*
/*
Reads audio data from the device.
Reads audio data from the device.
...
@@ -524,7 +535,7 @@ Use osaudio_get_avail() to determine how much data can be read without blocking.
...
@@ -524,7 +535,7 @@ Use osaudio_get_avail() to determine how much data can be read without blocking.
Returns 0 on success, < 0 on failure.
Returns 0 on success, < 0 on failure.
*/
*/
osaudio_result_t
osaudio_read
(
osaudio_t
audio
,
void
*
data
,
unsigned
int
frame_count
);
osaudio_result_t
osaudio_read
(
osaudio_t
audio
,
void
OSAUDIO_FAR
*
data
,
unsigned
int
frame_count
);
/*
/*
Drains the device.
Drains the device.
...
...
extras/osaudio/osaudio_miniaudio.c
View file @
9d461f6d
...
@@ -70,6 +70,7 @@ static ma_format osaudio_format_to_miniaudio(osaudio_format_t format)
...
@@ -70,6 +70,7 @@ static ma_format osaudio_format_to_miniaudio(osaudio_format_t format)
switch
(
format
)
switch
(
format
)
{
{
case
OSAUDIO_FORMAT_F32
:
return
ma_format_f32
;
case
OSAUDIO_FORMAT_F32
:
return
ma_format_f32
;
case
OSAUDIO_FORMAT_U8
:
return
ma_format_u8
;
case
OSAUDIO_FORMAT_S16
:
return
ma_format_s16
;
case
OSAUDIO_FORMAT_S16
:
return
ma_format_s16
;
case
OSAUDIO_FORMAT_S24
:
return
ma_format_s24
;
case
OSAUDIO_FORMAT_S24
:
return
ma_format_s24
;
case
OSAUDIO_FORMAT_S32
:
return
ma_format_s32
;
case
OSAUDIO_FORMAT_S32
:
return
ma_format_s32
;
...
@@ -82,6 +83,7 @@ static osaudio_format_t osaudio_format_from_miniaudio(ma_format format)
...
@@ -82,6 +83,7 @@ static osaudio_format_t osaudio_format_from_miniaudio(ma_format format)
switch
(
format
)
switch
(
format
)
{
{
case
ma_format_f32
:
return
OSAUDIO_FORMAT_F32
;
case
ma_format_f32
:
return
OSAUDIO_FORMAT_F32
;
case
ma_format_u8
:
return
OSAUDIO_FORMAT_U8
;
case
ma_format_s16
:
return
OSAUDIO_FORMAT_S16
;
case
ma_format_s16
:
return
OSAUDIO_FORMAT_S16
;
case
ma_format_s24
:
return
OSAUDIO_FORMAT_S24
;
case
ma_format_s24
:
return
OSAUDIO_FORMAT_S24
;
case
ma_format_s32
:
return
OSAUDIO_FORMAT_S32
;
case
ma_format_s32
:
return
OSAUDIO_FORMAT_S32
;
...
@@ -887,7 +889,7 @@ osaudio_result_t osaudio_pause(osaudio_t audio)
...
@@ -887,7 +889,7 @@ osaudio_result_t osaudio_pause(osaudio_t audio)
ma_atomic_bool32_set
(
&
audio
->
isPaused
,
MA_TRUE
);
ma_atomic_bool32_set
(
&
audio
->
isPaused
,
MA_TRUE
);
/* No need to stop the device if it's not active. */
/* No need to stop the device if it's not active. */
if
(
ma_atomic_bool32_get
(
&
audio
->
isActive
)
==
MA_FALSE
)
{
if
(
ma_atomic_bool32_get
(
&
audio
->
isActive
))
{
result
=
osaudio_result_from_miniaudio
(
ma_device_stop
(
&
audio
->
device
));
result
=
osaudio_result_from_miniaudio
(
ma_device_stop
(
&
audio
->
device
));
}
}
}
}
...
...
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