few additions to sounds

This commit is contained in:
2026-05-27 02:23:17 +03:00
parent 008ce7f5f7
commit ab9e5f47b3
3 changed files with 41 additions and 4 deletions

View File

@@ -15,9 +15,14 @@ public:
virtual double GetPlayTime() override;
virtual double Stop() override;
virtual void Continue() override;
virtual bool BIsPlaying() override;
virtual void SetIs3D( bool b ) override;
virtual void SetIsLooping( bool b ) override;
virtual void SetDirection( Vector v ) override;
virtual void SetTimeScale( float fValue ) override;
virtual void SetVolume( float fValue ) override;
virtual void SetPitch( float fValue ) override;
ma_sound m_sound;
CMiniAudio *m_pAudio;
@@ -70,19 +75,48 @@ double CMiniAudioPlayer::Stop()
void CMiniAudioPlayer::Continue()
{
ma_sound_start(&m_sound);
}
bool CMiniAudioPlayer::BIsPlaying()
{
return ma_sound_is_playing(&m_sound);
}
void CMiniAudioPlayer::SetIs3D( bool b )
{
ma_sound_set_spatialization_enabled(&m_sound, b);
}
void CMiniAudioPlayer::SetIsLooping( bool b )
{
ma_sound_set_looping(&m_sound, b);
}
void CMiniAudioPlayer::SetDirection( Vector v )
{
ma_sound_set_position(&m_sound, v.x, v.y, v.z);
}
void CMiniAudioPlayer::SetTimeScale( float fValue )
{
}
void CMiniAudioPlayer::SetVolume( float fValue )
{
ma_sound_set_volume(&m_sound, fValue);
}
void CMiniAudioPlayer::SetPitch( float fValue )
{
ma_sound_set_pitch(&m_sound, fValue);
}
IAudioPlayer *CMiniAudio::SpawnPlayer()
{
CMiniAudioPlayer *pPlayer;
@@ -110,6 +144,7 @@ void CMiniAudioManager::Init()
V_printf("ma_engine_init failed\n");
}
r = ma_engine_start(&m_engine);
ma_engine_listener_set_position(&m_engine, 0, 0, 0, 0);
if ( r != MA_SUCCESS )
{
V_printf("ma_engine_start failed\n");