Changeset 598:e65d59081bdd


Ignore:
Timestamp:
Sep 7, 2013, 9:43:20 PM (7 years ago)
Author:
Simon Cross <hodgestar@…>
Branch:
default
rebase_source:
bc36bcee983ad60fcd15382561bed262f5c3e597
Message:

Quieter sound.

Location:
nagslang
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nagslang/constants.py

    r454 r598  
    2020CHANNELS = 2   # 1 == mono, 2 == stereo
    2121BUFFER = 1024  # audio buffer size in no. of samples
     22DEFAULT_SOUND_VOLUME = 1.0  # sound volume
     23DEFAULT_MUSIC_VOLUME = 0.3  # music volume
    2224
    2325COLLISION_TYPE_OTHER = 0
  • nagslang/sound.py

    r591 r598  
    55from nagslang.options import options
    66from nagslang.resources import resources
    7 from nagslang.constants import FREQ, BITSIZE, CHANNELS, BUFFER
     7from nagslang.constants import (
     8    FREQ, BITSIZE, CHANNELS, BUFFER, DEFAULT_SOUND_VOLUME,
     9    DEFAULT_MUSIC_VOLUME)
    810
    911
     
    1214        pass
    1315
    14     def play_sound(self, name, volume=None):
     16    def play_sound(self, name, volume=DEFAULT_SOUND_VOLUME):
    1517        pass
    1618
    17     def play_music(self, name, volume=None):
     19    def play_music(self, name, volume=DEFAULT_MUSIC_VOLUME):
    1820        pass
    1921
     
    4345        return sound
    4446
    45     def play_sound(self, name, volume=1.0):
     47    def play_sound(self, name, volume=DEFAULT_SOUND_VOLUME):
    4648        sound = self.load_sound(name)
    4749        if sound is not None:
     
    4951            sound.play()
    5052
    51     def play_music(self, name, volume=1.0):
     53    def play_music(self, name, volume=DEFAULT_MUSIC_VOLUME):
    5254        if not options.music:
    5355            return
Note: See TracChangeset for help on using the changeset viewer.