aboutsummaryrefslogtreecommitdiffstats
path: root/src/audio_format.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/audio_format.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/audio_format.h b/src/audio_format.h
index 2475aa77e..bbebc51b1 100644
--- a/src/audio_format.h
+++ b/src/audio_format.h
@@ -61,9 +61,15 @@ static inline unsigned audio_format_sample_size(const struct audio_format *af)
return 4;
}
+static inline unsigned
+audio_format_frame_size(const struct audio_format *af)
+{
+ return audio_format_sample_size(af) * af->channels;
+}
+
static inline double audio_format_time_to_size(const struct audio_format *af)
{
- return af->sample_rate * af->channels * audio_format_sample_size(af);
+ return af->sample_rate * audio_format_frame_size(af);
}
static inline double audioFormatSizeToTime(const struct audio_format *af)