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
f6dee8d7
Commit
f6dee8d7
authored
Mar 06, 2019
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the dithering test.
parent
84605a0f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
tests/mal_dithering.c
tests/mal_dithering.c
+9
-9
No files found.
tests/mal_dithering.c
View file @
f6dee8d7
...
...
@@ -32,8 +32,8 @@ mal_uint32 on_convert_samples_out(mal_format_converter* pConverter, mal_uint32 f
void
on_send_to_device__original
(
mal_device
*
pDevice
,
void
*
pOutput
,
const
void
*
pInput
,
mal_uint32
frameCount
)
{
mal_assert
(
pDevice
->
format
==
mal_format_f32
);
mal_assert
(
pDevice
->
channels
==
1
);
mal_assert
(
pDevice
->
playback
.
format
==
mal_format_f32
);
mal_assert
(
pDevice
->
playback
.
channels
==
1
);
mal_sine_wave_read_f32
(
&
sineWave
,
frameCount
,
(
float
*
)
pOutput
);
...
...
@@ -43,11 +43,11 @@ void on_send_to_device__original(mal_device* pDevice, void* pOutput, const void*
void
on_send_to_device__dithered
(
mal_device
*
pDevice
,
void
*
pOutput
,
const
void
*
pInput
,
mal_uint32
frameCount
)
{
mal_assert
(
pDevice
->
channels
==
1
);
mal_assert
(
pDevice
->
playback
.
channels
==
1
);
mal_format_converter
*
pConverter
=
(
mal_format_converter
*
)
pDevice
->
pUserData
;
mal_assert
(
pConverter
!=
NULL
);
mal_assert
(
pDevice
->
format
==
pConverter
->
config
.
formatOut
);
mal_assert
(
pDevice
->
playback
.
format
==
pConverter
->
config
.
formatOut
);
mal_format_converter_read
(
pConverter
,
frameCount
,
pOutput
,
NULL
);
...
...
@@ -61,8 +61,8 @@ int do_dithering_test()
mal_result
result
;
config
=
mal_device_config_init
(
mal_device_type_playback
);
config
.
format
=
mal_format_f32
;
config
.
channels
=
1
;
config
.
playback
.
format
=
mal_format_f32
;
config
.
playback
.
channels
=
1
;
config
.
sampleRate
=
0
;
config
.
dataCallback
=
on_send_to_device__original
;
...
...
@@ -91,7 +91,7 @@ int do_dithering_test()
mal_format_converter_config
converterInConfig
=
mal_format_converter_config_init_new
();
converterInConfig
.
formatIn
=
mal_format_f32
;
// <-- From the sine wave generator.
converterInConfig
.
formatOut
=
srcFormat
;
converterInConfig
.
channels
=
config
.
channels
;
converterInConfig
.
channels
=
config
.
playback
.
channels
;
converterInConfig
.
ditherMode
=
mal_dither_mode_none
;
converterInConfig
.
onRead
=
on_convert_samples_in
;
converterInConfig
.
pUserData
=
&
sineWave
;
...
...
@@ -103,7 +103,7 @@ int do_dithering_test()
mal_format_converter_config
converterOutConfig
=
mal_format_converter_config_init_new
();
converterOutConfig
.
formatIn
=
srcFormat
;
converterOutConfig
.
formatOut
=
dstFormat
;
converterOutConfig
.
channels
=
config
.
channels
;
converterOutConfig
.
channels
=
config
.
playback
.
channels
;
converterOutConfig
.
ditherMode
=
ditherMode
;
converterOutConfig
.
onRead
=
on_convert_samples_out
;
converterOutConfig
.
pUserData
=
&
converterIn
;
...
...
@@ -112,7 +112,7 @@ int do_dithering_test()
return
-
3
;
}
config
.
playback
.
format
=
dstFormat
;
config
.
dataCallback
=
on_send_to_device__dithered
;
config
.
pUserData
=
&
converterOut
;
...
...
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