Ticket #250 (closed enhancement: fixed)

Opened 7 months ago

Last modified 6 months ago

Play random music

Reported by: qubodup Owned by: parpg
Priority: major Milestone: Techdemo 2
Component: scripts Version: trunk
Keywords: random, audio, shuffle Cc:
Time spent: 1d Time remaining: 1d
Time planned: 1d

Description

To display more of the available media, music tracks should be picked randomly for playback.

This can be done by replacing

self.sounds.playMusic("/music/preciouswasteland.ogg")

from scripts/world.py with

self.sounds.playMusic(random.choice(glob.glob(os.path.join("music", "*.ogg"))))

and adding

import random import glob import os

to the file

Sorry for this ... patch form

Attachments

Change History

follow-up: ↓ 2   Changed 7 months ago by b0rland_parpg

  • milestone changed from Techdemo 1 to Demo 1

in reply to: ↑ 1   Changed 7 months ago by qubodup

Replying to b0rland_parpg: Can we have this included in Techdemo1? It would be a shame to hold back material, it would seem like less than actually is to testers and the music writers want their work exposed as well of course.

  Changed 6 months ago by barra_parpg

  • milestone changed from Demo 1 to Techdemo 2

  Changed 6 months ago by barra_parpg

  • keywords random, audio, shuffle added

  Changed 6 months ago by barra_parpg

  • status changed from new to closed
  • resolution set to fixed

(In [527]) Ticket #250. Patch by qubodup:

  • Adding random audio track playback
  • Code review appreciated!
  • closes #250

Add/Change #250 (Play random music)

Author


E-mail address and user name can be saved in the Preferences.


Action
as closed
The resolution will be deleted. Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.