Skip to content

Commit

Permalink
Fix missing change volume function
Browse files Browse the repository at this point in the history
  • Loading branch information
capnkenny committed Jul 29, 2024
1 parent 71475be commit d85d52c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
2 changes: 1 addition & 1 deletion include/NovelRT/Ecs/Audio/AudioSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace NovelRT::Ecs::Audio
NovelRT::Timing::Timestamp _systemTime;
std::shared_ptr<PluginManagement::IResourceManagementPluginProvider> _resourceManagerPluginProvider;

// void ChangeAudioVolume(AudioEmitterComponent emitter, float desiredVolume);
void ChangeAudioVolume(AudioEmitterComponent emitter, float desiredVolume);

public:
AudioSystem(std::shared_ptr<PluginManagement::IResourceManagementPluginProvider> resourceManagerPluginProvider);
Expand Down
20 changes: 4 additions & 16 deletions src/NovelRT/Ecs/Audio/AudioSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,26 +221,14 @@ namespace NovelRT::Ecs::Audio
NovelRT::Utilities::Misc::Span<float>(asset.processedAudioFrames.data(), asset.processedAudioFrames.size()),
asset.channelCount, asset.sampleRate);
_soundCache.emplace(handle, asset);
// if (_mixer->IsLoaded(handle))
// {
// _soundCache.insert({_counter, handle});
// value = _counter;
_counter++;
// }
return handle;
}

// void AudioSystem::ChangeAudioVolume(AudioEmitterComponent emitter, float desiredVolume)
// {
// if (emitter.isMusic)
// {
// _mixer->SetMusicVolume(desiredVolume);
// }
// else
// {
// _mixer->SetSoundVolume(_soundCache.at(emitter.handle), desiredVolume);
// }
// }
void AudioSystem::ChangeAudioVolume(AudioEmitterComponent emitter, float desiredVolume)
{
_mixer->SetSourceVolume(emitter.handle, desiredVolume);
}

AudioSystem::~AudioSystem() noexcept
{
Expand Down

0 comments on commit d85d52c

Please sign in to comment.