16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 19:29:19 +02:00

audio transcript sound volume based filtering, minor ai logic fixes

This commit is contained in:
tmj-fstate
2019-03-22 21:43:36 +01:00
parent faaabf116b
commit 73af767312
4 changed files with 16 additions and 9 deletions

View File

@@ -861,6 +861,13 @@ sound_source::update_counter( sound_handle const Sound, int const Value ) {
// sound( Sound ).playing = std::max( 0, sound( Sound ).playing + Value );
sound( Sound ).playing += Value;
if( ( m_properties.gain > 0.f )
&& ( sound( Sound ).playing == 1 ) ) {
auto const &buffer { audio::renderer.buffer( sound( Sound ).buffer ) };
if( false == buffer.caption.empty() ) {
ui::Transcripts.Add( buffer.caption );
}
}
assert( sound( Sound ).playing >= 0 );
}