1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:57:45 +00:00

LibAudio+aplay: Make the aplay output look a little funner.

Show some information about the file we're playing, and display how many
samples we've played out of how many total.

This might be a bit buggy as I haven't tested it with many different files,
but it's a start. :^)
This commit is contained in:
Andreas Kling 2019-07-28 21:52:30 +02:00
parent b44d3faa1c
commit ae4a9e017a
3 changed files with 31 additions and 13 deletions

View file

@ -20,6 +20,12 @@ public:
RefPtr<ABuffer> get_more_samples();
int loaded_samples() const { return m_loaded_samples; }
int total_samples() const { return m_total_samples; }
u32 sample_rate() const { return m_sample_rate; }
u16 num_channels() const { return m_num_channels; }
u16 bits_per_sample() const { return m_bits_per_sample; }
private:
bool parse_header();
CFile m_file;
@ -28,4 +34,7 @@ private:
u32 m_sample_rate { 0 };
u16 m_num_channels { 0 };
u16 m_bits_per_sample { 0 };
int m_loaded_samples { 0 };
int m_total_samples { 0 };
};