Compare commits
2 Commits
65db973699
...
aca3a5af78
Author | SHA1 | Date | |
---|---|---|---|
aca3a5af78 | |||
5935a7fea8 |
@ -73,10 +73,10 @@ func (a *app) Init(ctx ui.Context) error {
|
||||
); err != nil {
|
||||
log.Printf("failed to load samples; %v\n", err)
|
||||
}
|
||||
if err := a.context.Audio.LoadSampleVolume(-1, "menu_interaction.mp3"); err != nil {
|
||||
if err := a.context.Audio.LoadSampleVolume(-.5, "menu_interaction.mp3"); err != nil {
|
||||
log.Printf("failed to load samples; %v\n", err)
|
||||
}
|
||||
if err := a.context.Audio.LoadSampleVolume(-2,
|
||||
if err := a.context.Audio.LoadSampleVolume(-1,
|
||||
"monster_jump.mp3",
|
||||
"player_move.mp3",
|
||||
); err != nil {
|
||||
|
@ -13,6 +13,7 @@ type appContext struct {
|
||||
|
||||
Settings *tins2021.Settings
|
||||
Score *tins2021.ScoreState
|
||||
Virtual *VirtualControls
|
||||
Debug bool
|
||||
|
||||
StarTexture tins2021.AnimatedTexture
|
||||
@ -192,7 +193,7 @@ func (app *appContext) switchToMenuMusic(ctx ui.Context) {
|
||||
if app.MenuMusic != nil {
|
||||
return
|
||||
}
|
||||
app.MenuMusic, _ = app.Audio.PlayMusic("song_menu.mp3", func(m *Music) {})
|
||||
app.MenuMusic, _ = app.Audio.PlayMusic("song_menu.mp3", func(m *Music) { m.AutoRepeat = true })
|
||||
gameMusic := app.GameMusic
|
||||
app.GameMusic = nil
|
||||
if gameMusic != nil {
|
||||
|
@ -80,11 +80,12 @@ func (p *AudioPlayer) PlaySample(name string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
volume := p.SampleVolume + sample.Volume
|
||||
speaker.Play(&effects.Volume{
|
||||
Streamer: p.resample(sample.Stream(), sample.SampleRate),
|
||||
Base: 2,
|
||||
Volume: p.SampleVolume - sample.Volume,
|
||||
Silent: p.SampleVolume == minVolume,
|
||||
Volume: volume,
|
||||
Silent: volume <= minVolume,
|
||||
})
|
||||
return nil
|
||||
}
|
||||
@ -107,7 +108,7 @@ func (p *AudioPlayer) PlayMusic(name string, init func(*Music)) (*Music, error)
|
||||
Streamer: p.resample(closer, format.SampleRate),
|
||||
Base: 2,
|
||||
Volume: p.MusicVolume,
|
||||
Silent: p.MusicVolume == minVolume,
|
||||
Silent: p.MusicVolume <= minVolume,
|
||||
},
|
||||
}
|
||||
if init != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user