mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
audio::PCM.totalSamples
This commit is contained in:
parent
70657d9e7b
commit
4d15ebb7de
4 changed files with 13 additions and 10 deletions
|
|
@ -31,6 +31,7 @@ audio::PCM* ogg::load_pcm(const std::filesystem::path& file, bool headerOnly) {
|
|||
vorbis_info* info = ov_info(&vf, -1);
|
||||
uint channels = info->channels;
|
||||
uint sampleRate = info->rate;
|
||||
size_t totalSamples = ov_pcm_total(&vf, -1);
|
||||
|
||||
if (!headerOnly) {
|
||||
const int bufferSize = 4096;
|
||||
|
|
@ -51,5 +52,5 @@ audio::PCM* ogg::load_pcm(const std::filesystem::path& file, bool headerOnly) {
|
|||
}
|
||||
|
||||
ov_clear(&vf);
|
||||
return new audio::PCM(std::move(data), channels, 16, sampleRate);
|
||||
return new audio::PCM(std::move(data), totalSamples, channels, 16, sampleRate);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue