0 Favourites

Python and XAudio2 - Play Resource

This forum is currently in read-only mode.
  • 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

    XAudio2.AutoplayResource(System.AppPath+"menu_move_01.wav",0)

    Every time I try to play a sound using a Python script it gives me an error:

    XAudio2: Failed to load file from disk. Check the filename exists and that the file is of a supported format. (0x80004005)

    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!

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread sticky
763 305,700
asikanddestroy's avatar
asikanddestroy
Unread hot topic
0 Favourites
What are you playing?
135 15,351
Tetriser's avatar
Tetriser
Unread hot topic
94 11,275
grigrizljac's avatar
grigrizljac