XAudio not playing OGG from resource

For questions about using Classic.

Post » Mon May 10, 2010 11:30 pm

Hi all.

I've been playing sounds from file in the past, but now I'm looking to see how it goes with using the sounds as resources instead.

After a good 20 minutes not understanding why the sound won't play, I found this thread:

[url:29ex4l81]http://www.scirra.com/forum/viewtopic.php?f=3&t=4884&p=38805[/url:29ex4l81]

Was it true back then that OGG files couldn't be played from resources, and if so, is it still true now?

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Tue May 11, 2010 12:19 pm

No-one else had this problem?

I'm going to go back and have a look at it this afternoon, but I'm pretty sure I've eliminated all human error and that this just doesn't work.

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Wed May 12, 2010 12:53 am

Well, it's definitely nothing my side, so it must be construct.

Converting both OGG files that I was using to WAV, I am able to load them as resources and then play them on their channel when I need them without problem.

The problem there is that the 15k OGG file becomes a 191k WAV file, and the 106k OGG file becomes more than 1.6 Mb.
Yes, I can probably get them down from that, but I'm not prepared to lose much quality to get the filesize down, when the OGG does it so well.

This is a real showstopper for me.
I can't see me developing anything in Construct with this restriction.

Is this just a bug that has been missed for so long, or is there another reason for it?

BTW, this forum hasn't died has it?
Seems to be getting quieter all the time.

Time for the Devs to start making regular appearances again perhaps?

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Wed May 12, 2010 10:51 am

I haven't really used XAudio2 yet but this is what I found.
After I added a ogg file to the files directory i was able to get it to play doing this:
[code:iknmdomk]+ Button: On Button clicked
-> XAudio2: Play music "bgm012.ogg"[/code:iknmdomk]
But not this:
[code:iknmdomk]+ Button: On Button clicked
-> XAudio2: Autoplay resource "bgm012.ogg" (No loop)[/code:iknmdomk]

Does that help?
B
79
S
24
G
54
Posts: 4,754
Reputation: 40,771

Post » Wed May 12, 2010 5:58 pm

Thanks for replying rojo.

I've found that using both methods you suggest gets the same results as you, except that the last 2/10ths of a second are cropped off the end of the sample (not played completely).

I mentioned the devs having to sort out the Xaudio side of construct by version 1.0 months ago, based solely on what others where saying in various threads.
Now I'm starting to put more sounds into the game, I can see where others were getting frustrated.

One of my projects can easily be transferred over to another dev platform, or even C++, because it's still in the design stages, but I've put a lot of effort into the Construct side of my other project, and it would be annoying to lose all that.

I'd like to hear what the devs think.
Is the XAudio where they want it to be at, or do they have plans to give it some serious attention.

As it stands, loading from file into channels works like a charm, but I'd prefer to store the samples away one way or another.

Any chance the devs will consider allowing us to load files from password-protected ZIP files?
Like I say, the playing of OGG files seems fine when loading from file into channels, so this would be a good solution.

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Wed May 12, 2010 9:36 pm

Xaudio2 is set up into two different categories, sound, and music.
Wav files while large in size on disk, remain about the same size when loaded into memory, thus making them comparatively easy to load and unload. This is why they are the only file type considered as sound, or usable as a sound fx.
Ogg while much smaller on disk than wavs can take up much more memory, and is only set up as music for this reason.

As I understand it XAudio2 is finished, with no other plans to change anything, I will add that since this is an open source project anybody is free to make up a plug that plays ogg's as a sound fx. I just pity anyone who tries to load a bunch of songs that way.
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Wed May 12, 2010 11:18 pm

Thanks for a very informative post Newt.
Much appreciated.

I'll take a look at getting the wav filesize down without losing too much quality, and have a play around.

The reason I wanted to use OGG was to keep the project filesize down, even though I don't have a clue how big it will be at the end.
I'm afraid I'm the same when making 3D models.
I like to get the best looking model with as few polys as possible if it's for a game rather than render, probably because I've seen too many poly-heavy models over the years.

Maybe I shouldn't be as strict on the size of the wav files until I get closer to finishing the game (but I know I'll spend hours in GoldWave getting them just right :lol: )

Thanks again for the info.

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Thu May 13, 2010 5:09 am

Don't forget there's always Python.
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests