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?