questions regarding sound API

  • and what’s the difference between PandaLoader.loadSfx and PandaLoader.loadMusic? are they just using the two different AudioManager objects from ShowBase? and other differences?

  • i can easily load a sound/music with loader.loadSfx and loader.loadMusic. but how do i “unload” the sound/music. the PandaLoader provides unload possibilities for all other types (model, texture, shader) but not for these.

  • does the Panda3D API allow for streamed sounds/music, or will all sounds/music be loaded into memory?

thanks,
kaweh

  • Exactly right–they are just using the two different AudioManager objects. No other differences. The intention here is that, since many games provide a separate volume control and/or mute option for sound effects and musics, loading them from separate AudioManagers gives you that control.

  • The sound objects are reference-counted, and are unloaded when the last reference goes away. Really, the same is true of models, textures, and so on, but because we have a ModelPool and TexturePool that might hang on to the reference counts, it’s sometimes necessary to explicitly “unload” these objects, by telling the ModelPool to release the reference.

  • As far as I know, there is no support for streamed audio at the present.

David

The new fmod-ex code streams audio from the hard drive. If you load an audio file that’s more than a couple hundred kbytes, it automatically loads it using fmod-ex’s streaming audio mode. Go ahead and try loading a large MP3 file, and then look in the task manager to see how much RAM that takes. It’s not much.