mirror of
https://gitlab.com/veloren/veloren.git
synced 2025-07-25 21:02:31 +00:00
Add audio buffer setting
This commit is contained in:
committed by
Joshua Barretto
parent
2253266542
commit
6cfee5c787
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-001.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-001.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-002.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-002.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-003.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-003.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-004.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-004.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-005.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-005.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-006.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-006.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-007.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-007.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-008.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-008.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-009.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-009.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-010.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-010.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-011.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-011.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-012.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-012.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-013.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-013.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-014.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-014.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-015.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-015.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-016.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-016.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-017.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-017.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-018.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-018.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-019.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-019.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-020.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-020.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-021.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-021.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-022.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-022.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-023.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-023.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-024.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/fast_water-024.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-001.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-001.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-002.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-002.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-003.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-003.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-004.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-004.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-005.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-005.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-006.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-006.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-007.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-007.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-008.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-008.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-009.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-009.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-010.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-010.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-011.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-011.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-012.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-012.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-013.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-013.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-014.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-014.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-015.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-015.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-016.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-016.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-017.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-017.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-018.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-018.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-019.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-019.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-020.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-020.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-021.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-021.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-022.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-022.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-023.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-023.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-024.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-024.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-025.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-025.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-026.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-026.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-027.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/river_sounds/running_water-027.ogg
(Stored with Git LFS)
Binary file not shown.
@ -68,7 +68,7 @@
|
||||
],
|
||||
sites: [Void],
|
||||
music_state: Activity(Explore),
|
||||
artist: ("DaforLynx", "https://daforlynx.neocities.org/"),
|
||||
artist: ("DaforLynx", "https://dafor.link/"),
|
||||
)),
|
||||
Individual((
|
||||
title: "Song of the Eldwood",
|
||||
@ -81,7 +81,7 @@
|
||||
],
|
||||
sites: [Void],
|
||||
music_state: Activity(Explore),
|
||||
artist: ("DaforLynx", "https://daforlynx.neocities.org/"),
|
||||
artist: ("DaforLynx", "https://dafor.link/"),
|
||||
)),
|
||||
Individual((
|
||||
title: "Torii",
|
||||
@ -239,7 +239,7 @@
|
||||
],
|
||||
sites: [Void],
|
||||
music_state: Activity(Explore),
|
||||
artist: ("DaforLynx", "https://daforlynx.neocities.org/"),
|
||||
artist: ("DaforLynx", "https://dafor.link/"),
|
||||
)),
|
||||
Individual((
|
||||
title: "Jungle Ambient",
|
||||
@ -334,7 +334,7 @@
|
||||
],
|
||||
sites: [Void],
|
||||
music_state: Activity(Explore),
|
||||
artist: ("DaforLynx", "https://daforlynx.neocities.org/"),
|
||||
artist: ("DaforLynx", "https://dafor.link/"),
|
||||
)),
|
||||
Individual((
|
||||
title: "Winter Falls",
|
||||
@ -347,7 +347,7 @@
|
||||
],
|
||||
sites: [Void],
|
||||
music_state: Activity(Explore),
|
||||
artist: ("DaforLynx", "https://daforlynx.neocities.org/"),
|
||||
artist: ("DaforLynx", "https://dafor.link/"),
|
||||
)),
|
||||
Individual((
|
||||
title: "Short Meandering",
|
||||
@ -664,7 +664,7 @@
|
||||
Settlement(SavannahTown),
|
||||
],
|
||||
music_state: Activity(Explore),
|
||||
artist: ("DaforLynx", "https://daforlynx.neocities.org/"),
|
||||
artist: ("DaforLynx", "https://dafor.link/"),
|
||||
)),
|
||||
Individual((
|
||||
title: "Starlit Pathways",
|
||||
@ -680,7 +680,7 @@
|
||||
Settlement(SavannahTown),
|
||||
],
|
||||
music_state: Activity(Explore),
|
||||
artist: ("DaforLynx", "https://daforlynx.neocities.org/"),
|
||||
artist: ("DaforLynx", "https://dafor.link/"),
|
||||
)),
|
||||
Individual((
|
||||
title: "Fiesta Del Pueblo",
|
||||
@ -954,7 +954,7 @@
|
||||
// ("voxygen.audio.soundtrack.combat.barred_paths.barred_paths-loop", 54.545, Activity(Combat(High)), None),
|
||||
// ("voxygen.audio.soundtrack.combat.barred_paths.barred_paths-end", 6.0, Transition(Combat(High), Explore), None),
|
||||
// ],
|
||||
// artist: ("DaforLynx", "https://daforlynx.neocities.org/"),
|
||||
// artist: ("DaforLynx", "https://dafor.link/"),
|
||||
// ),
|
||||
// Segmented(
|
||||
// title: "Reversal",
|
||||
@ -969,7 +969,7 @@
|
||||
// ("voxygen.audio.soundtrack.combat.reversal.reversal-loop", 60.0, Activity(Combat(High)), None),
|
||||
// ("voxygen.audio.soundtrack.combat.reversal.reversal-end", 3.666, Transition(Combat(High), Explore), None),
|
||||
// ],
|
||||
// artist: ("DaforLynx", "https://daforlynx.neocities.org/"),
|
||||
// artist: ("DaforLynx", "https://dafor.link/"),
|
||||
// ),
|
||||
// Segmented(
|
||||
// title: "Clash",
|
||||
|
@ -64,11 +64,6 @@ pub fn to_decibels(amplitude: f32) -> Decibels {
|
||||
}
|
||||
}
|
||||
|
||||
pub enum MasterEffect {
|
||||
SfxFilter(FilterHandle),
|
||||
AmbienceFilter(FilterHandle),
|
||||
}
|
||||
|
||||
struct Tracks {
|
||||
music: TrackHandle,
|
||||
ui: TrackHandle,
|
||||
@ -166,8 +161,16 @@ enum AudioCreationError {
|
||||
}
|
||||
|
||||
impl AudioFrontendInner {
|
||||
fn new(num_sfx_channels: usize, num_ui_channels: usize) -> Result<Self, AudioCreationError> {
|
||||
let mut manager = AudioManager::<DefaultBackend>::new(AudioManagerSettings::default())
|
||||
fn new(
|
||||
num_sfx_channels: usize,
|
||||
num_ui_channels: usize,
|
||||
buffer_size: usize,
|
||||
) -> Result<Self, AudioCreationError> {
|
||||
let manager_settings = AudioManagerSettings {
|
||||
internal_buffer_size: buffer_size,
|
||||
..Default::default()
|
||||
};
|
||||
let mut manager = AudioManager::<DefaultBackend>::new(manager_settings)
|
||||
.map_err(AudioCreationError::Manager)?;
|
||||
|
||||
let mut clock = manager
|
||||
@ -296,8 +299,9 @@ impl AudioFrontend {
|
||||
num_ui_channels: usize,
|
||||
subtitles: bool,
|
||||
combat_music_enabled: bool,
|
||||
buffer_size: usize,
|
||||
) -> Self {
|
||||
let inner = AudioFrontendInner::new(num_sfx_channels, num_ui_channels)
|
||||
let inner = AudioFrontendInner::new(num_sfx_channels, num_ui_channels, buffer_size)
|
||||
.inspect_err(|err| match err {
|
||||
AudioCreationError::Manager(e) => {
|
||||
#[cfg(unix)]
|
||||
|
@ -160,6 +160,7 @@ fn main() {
|
||||
settings.audio.subtitles,
|
||||
// settings.audio.combat_music_enabled,
|
||||
false, // We're disabling combat music for now
|
||||
settings.audio.buffer_size,
|
||||
),
|
||||
// AudioOutput::Device(ref dev) => Some(dev.clone()),
|
||||
};
|
||||
|
@ -49,6 +49,9 @@ pub struct AudioSettings {
|
||||
pub music_spacing: f32,
|
||||
pub subtitles: bool,
|
||||
pub combat_music_enabled: bool,
|
||||
/// The size of the sample buffer Kira uses. Increasing this may improve
|
||||
/// audio performance at the cost of audio latency.
|
||||
pub buffer_size: usize,
|
||||
|
||||
/// Audio Device that Voxygen will use to play audio.
|
||||
pub output: AudioOutput,
|
||||
@ -62,12 +65,13 @@ impl Default for AudioSettings {
|
||||
music_volume: AudioVolume::new(0.5, false),
|
||||
sfx_volume: AudioVolume::new(0.8, false),
|
||||
ambience_volume: AudioVolume::new(0.8, false),
|
||||
num_sfx_channels: 64,
|
||||
num_sfx_channels: 48,
|
||||
num_ui_channels: 16,
|
||||
music_spacing: 1.0,
|
||||
subtitles: false,
|
||||
output: AudioOutput::Automatic,
|
||||
combat_music_enabled: false,
|
||||
buffer_size: 256,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user