mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-15 18:30:27 -04:00
Bumped default sample rate for generating computer speaker beeps to avoid artifacts and made it a setting.
This commit is contained in:
parent
6f9f27fe02
commit
d869ba4df9
@ -105,6 +105,13 @@ opencomputers {
|
||||
# importantly, can only render code page 437 (as opposed to...
|
||||
# a *lot* of unicode).
|
||||
fontRenderer: "unifont"
|
||||
|
||||
# The sample rate used for generating beeps of computers' internal
|
||||
# speakers. Use custom values at your own responsibility here; if it
|
||||
# breaks OC you'll get no support. Some potentially reasonable
|
||||
# lower values are 16000 or even 8000 (which was the old default, but
|
||||
# leads to artifacting on certain frequencies).
|
||||
beepSampleRate: 44100
|
||||
}
|
||||
|
||||
# Computer related settings, concerns server performance and security.
|
||||
|
@ -49,6 +49,7 @@ class Settings(val config: Config) {
|
||||
}
|
||||
val monochromeColor = Integer.decode(config.getString("client.monochromeColor"))
|
||||
val fontRenderer = config.getString("client.fontRenderer")
|
||||
val beepSampleRate = config.getInt("client.beepSampleRate")
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
// computer
|
||||
|
@ -6,6 +6,7 @@ import cpw.mods.fml.common.FMLCommonHandler
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent
|
||||
import li.cil.oc.OpenComputers
|
||||
import li.cil.oc.Settings
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.client.audio.SoundCategory
|
||||
import org.lwjgl.BufferUtils
|
||||
@ -23,7 +24,7 @@ import scala.collection.mutable
|
||||
* tick handler.
|
||||
*/
|
||||
object Audio {
|
||||
private def sampleRate = 8000
|
||||
private def sampleRate = Settings.get.beepSampleRate
|
||||
|
||||
private val sources = mutable.Set.empty[Source]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user