Python and XAudio2 - Play Resource

For questions about using Classic.

Post » Sun Sep 22, 2013 2:10 pm

I'm trying to use XAudio2 in a Python script, mainly playing sounds / resources. My question is: how do I do this? Do I have to


Every time I try to play a sound using a Python script it gives me an error:
[CODE]XAudio2: Failed to load file from disk. Check the filename exists and that the file is of a supported format. (0x80004005)[/CODE]

That resource / file is a simple .WAV file, playing well from an event when called, but not from script. This would help me greatly if I could invoke it using Python, so any help appreciated, as always!
Posts: 28
Reputation: 435

Post » Sun Sep 22, 2013 8:42 pm

The action equivilent of the script is a combo select, so in python you would use a integer index. 0 for the first resource, 1 for the second and so on. To use a filename you'll have to use "play from file" and have the files alongside your exe.
You could alternatively use the resource plugin to avoid integers.
Posts: 5,555
Reputation: 85,323

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests