summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorDavid Isaksson <davidisaksson93@gmail.com>2021-09-23 21:16:03 +0200
committerBrian Gianforcaro <b.gianfo@gmail.com>2021-11-08 16:29:25 -0800
commitb6d075bb0105dd5c66760e274074eb91deff3df3 (patch)
treee993e9e34e519908c78ff3556f5b29d903e76549 /Userland/Services
parentfa4255bcf11889f0ab0739e04502ff927e246f14 (diff)
downloadserenity-b6d075bb0105dd5c66760e274074eb91deff3df3.zip
LibAudio: Rename Audio::Frame -> Audio::Sample
"Frame" is an MPEG term, which is not only unintuitive but also overloaded with different meaning by other codecs (e.g. FLAC). Therefore, use the standard term Sample for the central audio structure. The class is also extracted to its own file, because it's becoming quite large. Bundling these two changes means not distributing similar modifications (changing names and paths) across commits. Co-authored-by: kleines Filmröllchen <malu.bertsch@gmail.com>
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/AudioServer/Mixer.cpp6
-rw-r--r--Userland/Services/AudioServer/Mixer.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Services/AudioServer/Mixer.cpp b/Userland/Services/AudioServer/Mixer.cpp
index bc57b25eda..99d6038930 100644
--- a/Userland/Services/AudioServer/Mixer.cpp
+++ b/Userland/Services/AudioServer/Mixer.cpp
@@ -77,8 +77,8 @@ void Mixer::mix()
active_mix_queues.remove_all_matching([&](auto& entry) { return !entry->client(); });
- Audio::Frame mixed_buffer[1024];
- auto mixed_buffer_length = (int)(sizeof(mixed_buffer) / sizeof(Audio::Frame));
+ Audio::Sample mixed_buffer[1024];
+ auto mixed_buffer_length = (int)(sizeof(mixed_buffer) / sizeof(Audio::Sample));
m_main_volume.advance_time();
@@ -94,7 +94,7 @@ void Mixer::mix()
for (int i = 0; i < mixed_buffer_length; ++i) {
auto& mixed_sample = mixed_buffer[i];
- Audio::Frame sample;
+ Audio::Sample sample;
if (!queue->get_next_sample(sample))
break;
sample.log_multiply(SAMPLE_HEADROOM);
diff --git a/Userland/Services/AudioServer/Mixer.h b/Userland/Services/AudioServer/Mixer.h
index a9dbde4cc8..0cd48c8500 100644
--- a/Userland/Services/AudioServer/Mixer.h
+++ b/Userland/Services/AudioServer/Mixer.h
@@ -40,7 +40,7 @@ public:
bool is_full() const { return m_queue.size() >= 3; }
void enqueue(NonnullRefPtr<Audio::Buffer>&&);
- bool get_next_sample(Audio::Frame& sample)
+ bool get_next_sample(Audio::Sample& sample)
{
if (m_paused)
return false;