mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
al streaming fix
This commit is contained in:
parent
75ee269db3
commit
d41973583c
4 changed files with 25 additions and 13 deletions
|
|
@ -200,7 +200,6 @@ void ALSpeaker::stop() {
|
|||
if (source) {
|
||||
AL_CHECK(alSourceStop(source));
|
||||
al->freeSource(source);
|
||||
source = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -351,8 +351,8 @@ Channel* audio::get_channel(int index) {
|
|||
return channels.at(index).get();
|
||||
}
|
||||
|
||||
float audio::get_master_volume() {
|
||||
return channels.at(0)->getVolume();
|
||||
size_t audio::count_speakers() {
|
||||
return speakers.size();
|
||||
}
|
||||
|
||||
void audio::update(double delta) {
|
||||
|
|
@ -362,7 +362,7 @@ void audio::update(double delta) {
|
|||
entry.second->update(delta);
|
||||
}
|
||||
|
||||
float masterVolume = get_master_volume();
|
||||
float masterVolume = channels.at(0)->getVolume();
|
||||
for (auto it = speakers.begin(); it != speakers.end();) {
|
||||
auto speaker = it->second.get();
|
||||
int speakerChannel = speaker->getChannel();
|
||||
|
|
|
|||
|
|
@ -467,8 +467,8 @@ namespace audio {
|
|||
/// @return channel or nullptr
|
||||
extern Channel* get_channel(int index);
|
||||
|
||||
/// @brief Get volume of the master channel
|
||||
extern float get_master_volume();
|
||||
/// @brief Get alive speakers number (including paused)
|
||||
extern size_t count_speakers();
|
||||
|
||||
/// @brief Update audio streams and sound instanced
|
||||
/// @param delta time elapsed since the last update (seconds)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue