|
@@ -110,7 +110,7 @@ size_t SoundCompiler::compile_if_wav(Filesystem& fs, const char* resource_path)
|
|
|
m_sound_header.channels = header.fmt_channels;
|
|
m_sound_header.channels = header.fmt_channels;
|
|
|
m_sound_header.block_size = header.fmt_block_align;
|
|
m_sound_header.block_size = header.fmt_block_align;
|
|
|
m_sound_header.bits_ps = header.fmt_bits_ps;
|
|
m_sound_header.bits_ps = header.fmt_bits_ps;
|
|
|
- m_sound_header.sound_type = ST_WAV;
|
|
|
|
|
|
|
+ m_sound_header.sound_type = SoundType::WAV;
|
|
|
|
|
|
|
|
m_sound_data_size = header.data_size;
|
|
m_sound_data_size = header.data_size;
|
|
|
m_sound_data = (uint8_t*)default_allocator().allocate(m_sound_data_size);
|
|
m_sound_data = (uint8_t*)default_allocator().allocate(m_sound_data_size);
|
|
@@ -152,11 +152,11 @@ size_t SoundCompiler::compile_if_ogg(Filesystem& fs, const char* resource_path)
|
|
|
m_sound_header.version = SOUND_VERSION;
|
|
m_sound_header.version = SOUND_VERSION;
|
|
|
m_sound_header.size = size;
|
|
m_sound_header.size = size;
|
|
|
m_sound_header.sample_rate = rate;
|
|
m_sound_header.sample_rate = rate;
|
|
|
- m_sound_header.avg_bytes_ps = -1;
|
|
|
|
|
|
|
+ m_sound_header.block_size = (channels * 16) / 8;
|
|
|
|
|
+ m_sound_header.avg_bytes_ps = rate * ((channels * 16) / 8);
|
|
|
m_sound_header.channels = channels;
|
|
m_sound_header.channels = channels;
|
|
|
- m_sound_header.block_size = -1;
|
|
|
|
|
m_sound_header.bits_ps = 16;
|
|
m_sound_header.bits_ps = 16;
|
|
|
- m_sound_header.sound_type = ST_OGG;
|
|
|
|
|
|
|
+ m_sound_header.sound_type = SoundType::OGG;
|
|
|
|
|
|
|
|
m_sound_data_size = size;
|
|
m_sound_data_size = size;
|
|
|
m_sound_data = (uint8_t*)default_allocator().allocate(m_sound_data_size);
|
|
m_sound_data = (uint8_t*)default_allocator().allocate(m_sound_data_size);
|