AUD: Stream sounds packed into the blend file.

Have you ever wanted to be able to use aud with sound files that have been packed into blender? Well it’s possible!
Here’s how you do it:

1: Pack the sound:

 I don't know if there is a better way but here's how I do it. 
  •  Create a new sound actuator on an object (it can be any object). 
    
  •  Load a sound in that actuator. 
    
  •  Click on Files --> External Data ---> Pack into .blend file 
    

2: Access the sound with python.


from bpy import data
import aud

#Get the first sound file that is packed. You can get the filename with "sound.name".
sound = data.sounds[0] 

f = sound.factory # Create a AUD factory with the sound

aud.device().play(f) # Play the factory

That is how you play a sound packed within your blend file. Easy enough don’t you think?

Example : aud.blend (1.21 MB)

Hi dberube4!

Have you ever wanted to be able to use aud with sound files that have been packed into blender?

Yes, i want it! And i have done it ^^ But it works only with the internal player (because the use of bpy). I develope a game, so that’s a big problem :frowning:

Can you take a look at this thread:
http://www.blenderartists.org/forum/showthread.php?337488-Audaspace-and-bpy-in-standalone

Maybe you know the answer, if there is any.

Thank you,
MrLarodos

This will only work in the internal player, so put a disclaimer - we try to avoid mentioning BPY here

And here is the solution, which works with Audaspace and packed sounds in the external player:
http://www.blenderartists.org/forum/showthread.php?337488-Audaspace-and-bpy-in-standalone