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
56dbcb52
Commit
56dbcb52
authored
Aug 16, 2020
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for fading in to sound groups.
parent
1baf3e94
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
research/ma_engine.c
research/ma_engine.c
+2
-1
research/ma_engine.h
research/ma_engine.h
+14
-0
No files found.
research/ma_engine.c
View file @
56dbcb52
...
@@ -37,6 +37,7 @@ int main(int argc, char** argv)
...
@@ -37,6 +37,7 @@ int main(int argc, char** argv)
//ma_engine_sound_group_set_pan(&engine, NULL, -1);
//ma_engine_sound_group_set_pan(&engine, NULL, -1);
ma_engine_sound_group_set_pitch
(
&
engine
,
NULL
,
1
.
0
f
);
ma_engine_sound_group_set_pitch
(
&
engine
,
NULL
,
1
.
0
f
);
ma_engine_sound_group_set_fade_in
(
&
engine
,
NULL
,
4000
);
/*ma_engine_sound_set_volume(&engine, &sound, 0.25f);*/
/*ma_engine_sound_set_volume(&engine, &sound, 0.25f);*/
//ma_engine_sound_set_pitch(&engine, &sound, 2.0f);
//ma_engine_sound_set_pitch(&engine, &sound, 2.0f);
...
@@ -58,7 +59,7 @@ int main(int argc, char** argv)
...
@@ -58,7 +59,7 @@ int main(int argc, char** argv)
ma_engine_play_sound(&engine, argv[3], NULL);*/
ma_engine_play_sound(&engine, argv[3], NULL);*/
#endif
#endif
#if
1
#if
0
float pitch = 1;
float pitch = 1;
float pitchStep = 0.01f;
float pitchStep = 0.01f;
float pitchMin = 0.125f;
float pitchMin = 0.125f;
...
...
research/ma_engine.h
View file @
56dbcb52
...
@@ -997,6 +997,7 @@ MA_API ma_result ma_engine_sound_group_set_gain_db(ma_engine* pEngine, ma_sound_
...
@@ -997,6 +997,7 @@ MA_API ma_result ma_engine_sound_group_set_gain_db(ma_engine* pEngine, ma_sound_
MA_API
ma_result
ma_engine_sound_group_set_effect
(
ma_engine
*
pEngine
,
ma_sound_group
*
pGroup
,
ma_effect
*
pEffect
);
MA_API
ma_result
ma_engine_sound_group_set_effect
(
ma_engine
*
pEngine
,
ma_sound_group
*
pGroup
,
ma_effect
*
pEffect
);
MA_API
ma_result
ma_engine_sound_group_set_pan
(
ma_engine
*
pEngine
,
ma_sound_group
*
pGroup
,
float
pan
);
MA_API
ma_result
ma_engine_sound_group_set_pan
(
ma_engine
*
pEngine
,
ma_sound_group
*
pGroup
,
float
pan
);
MA_API
ma_result
ma_engine_sound_group_set_pitch
(
ma_engine
*
pEngine
,
ma_sound_group
*
pGroup
,
float
pitch
);
MA_API
ma_result
ma_engine_sound_group_set_pitch
(
ma_engine
*
pEngine
,
ma_sound_group
*
pGroup
,
float
pitch
);
MA_API
ma_result
ma_engine_sound_group_set_fade_in
(
ma_engine
*
pEngine
,
ma_sound_group
*
pGroup
,
ma_uint64
fadeTimeInMilliseconds
);
MA_API
ma_result
ma_engine_listener_set_position
(
ma_engine
*
pEngine
,
ma_vec3
position
);
MA_API
ma_result
ma_engine_listener_set_position
(
ma_engine
*
pEngine
,
ma_vec3
position
);
MA_API
ma_result
ma_engine_listener_set_rotation
(
ma_engine
*
pEngine
,
ma_quat
rotation
);
MA_API
ma_result
ma_engine_listener_set_rotation
(
ma_engine
*
pEngine
,
ma_quat
rotation
);
...
@@ -6554,6 +6555,19 @@ MA_API ma_result ma_engine_sound_group_set_pitch(ma_engine* pEngine, ma_sound_gr
...
@@ -6554,6 +6555,19 @@ MA_API ma_result ma_engine_sound_group_set_pitch(ma_engine* pEngine, ma_sound_gr
return
MA_SUCCESS
;
return
MA_SUCCESS
;
}
}
MA_API
ma_result
ma_engine_sound_group_set_fade_in
(
ma_engine
*
pEngine
,
ma_sound_group
*
pGroup
,
ma_uint64
fadeTimeInMilliseconds
)
{
if
(
pEngine
==
NULL
)
{
return
MA_INVALID_ARGS
;
}
if
(
pGroup
==
NULL
)
{
pGroup
=
&
pEngine
->
masterSoundGroup
;
}
return
ma_dual_fader_set_fade
(
&
pGroup
->
effect
.
fader
,
0
,
0
,
1
,
pGroup
->
effect
.
fader
.
timeInFramesCur
,
pGroup
->
effect
.
fader
.
timeInFramesCur
+
(
fadeTimeInMilliseconds
*
pGroup
->
effect
.
fader
.
config
.
sampleRate
)
/
1000
);
}
MA_API
ma_result
ma_engine_listener_set_position
(
ma_engine
*
pEngine
,
ma_vec3
position
)
MA_API
ma_result
ma_engine_listener_set_position
(
ma_engine
*
pEngine
,
ma_vec3
position
)
{
{
...
...
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