loading sounds asynchronously fails

Bug #940390 reported by Nemesis#13
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Panda3D
Fix Released
Undecided
Josh Enes

Bug Description

loader.loadSound should be capable of loading sounds asynchronously (though a callback param), but it fails since it needs the class AudioLoadRequest, which is not in the code base.

That said, there's no way to load sound files asynchronously.

Tags: async sound
Revision history for this message
rdb (rdb) wrote :

Could you provide a testcase?

Revision history for this message
Nemesis#13 (dev) wrote :

Sure.

audioload.py:
from direct.showbase.ShowBase import ShowBase

def loaded(*args):
    print "call. got args: "+str(*args)

ShowBase()
songname="whatever.mp3"
s = loader.loadSound(base.musicManager, songname, callback=loaded)
#s.play()

run()

Output:
>> python2 audioload.py
Known pipe types:
  glxGraphicsPipe
(all display modules loaded.)
:display:glxdisplay(warning): No suitable FBConfig contexts available; using XVisual only.
depth_bits=24 color_bits=24 alpha_bits=8 stencil_bits=8 back_buffers=1 force_hardware=1
Traceback (most recent call last):
  File "audioload.py", line 9, in <module>
    s = loader.loadSound(base.musicManager, songname, callback=loaded)
  File "/usr/share/panda3d/direct/showbase/Loader.py", line 765, in loadSound
    request = AudioLoadRequest(manager, soundPath, positional)
NameError: global name 'AudioLoadRequest' is not defined

Revision history for this message
Josh Enes (joshenes) wrote :

This patch will cause AudioLoadRequest to be interrogated, and thus included in the Python API.

Changed in panda3d:
assignee: nobody → Josh Enes (joshenes)
status: New → Confirmed
Revision history for this message
rdb (rdb) wrote :

Many thanks for the help! It's really supposed to be in the IGATEFILES list for the panda/src/audio directory in makepanda.py, but this should do the trick too. I've committed your patch and picked it up for the 1.8 branch.

Changed in panda3d:
milestone: none → 1.8.1
status: Confirmed → Fix Committed
rdb (rdb)
Changed in panda3d:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.