Sound problem

For questions about using Classic.

Post » Sat Nov 13, 2010 4:41 pm

First of all i am a bit disapointed that Construct cant play mp3 file but oh well.

i am trying to play a sound effects here and it either doesn play or play badly.
whenever i try playing wav files (and they are metting all the requaired prosperities) they just dont play.
when i try to use ogg they DO play but the sound is not only bad quality (like being riped and twirled or like 1 milisecond echo) but have that ugly pick at the end when it ends playing.

when i preview the wav it plays just right.
when i preview the ogg - Construct crashes or just doesnt start previewing

runing the game with debugger and wav sound leaves me with such window:

[quote:2z5txax7]Debugger first-time message:

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

any idea what the heck? and i would gladly use that XAudio2 tutorial from the wiki but the link is dead or broken leaving me with 404 error.
ImageImageImageImage
B
26
S
7
G
7
Posts: 572
Reputation: 6,097

Post » Sat Nov 13, 2010 5:03 pm

[quote="irbis":582stvan]First of all i am a bit disapointed that Construct cant play mp3 file but oh well.[/quote:582stvan]

Construct most certainly does support mp3s. Use the "play music" action to do so. One look at the Xaudio wiki page clarifies which formats are supported.

[quote="irbis":582stvan]i am trying to play a sound effects here and it either doesn play or play badly.
whenever i try playing wav files (and they are metting all the requaired prosperities) they just dont play.
when i try to use ogg they DO play but the sound is not only bad quality (like being riped and twirled or like 1 milisecond echo) but have that ugly pick at the end when it ends playing.

when i preview the wav it plays just right.
when i preview the ogg - Construct crashes or just doesnt start previewing

runing the game with debugger and wav sound leaves me with such window:

Debugger first-time message:

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



any idea what the heck? and i would gladly use that XAudio2 tutorial from the wiki but the link is dead or broken leaving me with 404 error.[/quote:582stvan]

Do you have specified the correct path to your sound file? It should be apppath&"filename.xyz" if the sound file is in the same directory as the cap file.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Sat Nov 13, 2010 5:20 pm

[quote:t5f837yu]Construct most certainly does support mp3s. Use the "play music" action to do so. One look at the Xaudio wiki page clarifies which formats are supported.[/quote:t5f837yu]

yes but:

[quote:t5f837yu]XAudio2 has two main ways of playing sounds: as music (actions under the music category), or on one of several channels (actions under all other categories). Music can only play one thing at a time, like the game's music track. There are lots of channels, however, and these can be used to play lots of sound effects simultaneously. [/quote:t5f837yu]

so i cant use mp3 as file format for SFX.
[quote:t5f837yu]
Do you have specified the correct path to your sound file? It should be apppath&"filename.xyz" if the sound file is in the same directory as the cap file.[/quote:t5f837yu]

fixed that. aparently ive been missing the wav when having the ogg. thank you

but that still does not fixes the main issue: the sound quality. wav sounds as bad as ogg. its okey for about 1 second then it goes crazy.

maybe the event is responsible?
because i have attached the sound to an constant action. literaly to the moving. so every time my object moves a SFX is constantly playing untill he stopes.
ImageImageImageImage
B
26
S
7
G
7
Posts: 572
Reputation: 6,097

Post » Sat Nov 13, 2010 5:25 pm

[quote="irbis":z593tu58]maybe the event is responsible?
because i have attached the sound to an constant action. literaly to the moving. so every time my object moves a SFX is constantly playing untill he stopes.[/quote:z593tu58]

If you have an event that runs every tick and plays a soundfile, I imagine it would go crazy. Try to play it only every x ms for example.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Sat Nov 13, 2010 5:47 pm

[quote="PixelRebirth":2fg6y65s][quote="irbis":2fg6y65s]maybe the event is responsible?
because i have attached the sound to an constant action. literaly to the moving. so every time my object moves a SFX is constantly playing untill he stopes.[/quote:2fg6y65s]

If you have an event that runs every tick and plays a soundfile, I imagine it would go crazy. Try to play it only every x ms for example.[/quote:2fg6y65s]

oooh so its not like the Construct play one after another each at the time but starts raining with them? but how can i do that it playes right after another? should i check the exact duration in ms and then enter command "wait" wih that ms?
i dont know how to execute that :(
imagine spaceship, when it moves - the engines makes an ambient sound. and i want that sound to play endlessly on loop untill player stops moving. how you would do that?


another question but not connected to sound is: how to set the same image points for a whole set of animation frames? my sprite has 10 of them and i just dont feel like setting two for each of them manualy
ImageImageImageImage
B
26
S
7
G
7
Posts: 572
Reputation: 6,097

Post » Sat Nov 13, 2010 6:00 pm

[quote="irbis":3ek60pkd]another question but not connected to sound is: how to set the same image points for a whole set of animation frames? my sprite has 10 of them and i just dont feel like setting two for each of them manualy[/quote:3ek60pkd]

Yes, if you hold ALT while you click to set your image point, it will be changed for all frames of the animation.

[quote="irbis":3ek60pkd]oooh so its not like the Construct play one after another each at the time but starts raining with them? but how can i do that it playes right after another? should i check the exact duration in ms and then enter command "wait" wih that ms?
i dont know how to execute that :(
imagine spaceship, when it moves - the engines makes an ambient sound. and i want that sound to play endlessly on loop untill player stops moving. how you would do that? [/quote:3ek60pkd]

Well you can specify to loop a soundfile when you load/autoplay it. I bet you noticed that. You just should make sure that the event is only executed one time, and not all the time. Depending on the events you use the TRIGGER ONCE WHILE TRUE condition might prove useful.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Sat Nov 13, 2010 10:15 pm

[quote:1b9x85ej]Yes, if you hold ALT while you click to set your image point, it will be changed for all frames of the animation.[/quote:1b9x85ej]
oh my god THANK YOU so much!
it was like digging with a spoon.

[quote:1b9x85ej]Well you can specify to loop a soundfile when you load/autoplay it. I bet you noticed that. You just should make sure that the event is only executed one time, and not all the time. Depending on the events you use the TRIGGER ONCE WHILE TRUE condition might prove useful.[/quote:1b9x85ej]

you mean the "trigger once whole true" under "special condition"? how should i add it?

after my normal conditions or before? or as a sub-event? i am asking because when adding it after the conditon the sound stoped working. as a matter of fact i wanted to use it for diffrent puropus too but it doesnt work also. so what i am doing wrong?

also how do i.... emmm. loop commands? i mean more like - "how do i point which commands should be looped"?
ImageImageImageImage
B
26
S
7
G
7
Posts: 572
Reputation: 6,097

Post » Mon Nov 15, 2010 11:47 am

[quote="irbis":1or7j8em]you mean the "trigger once whole true" under "special condition"? how should i add it?

after my normal conditions or before? or as a sub-event? i am asking because when adding it after the conditon the sound stoped working. as a matter of fact i wanted to use it for diffrent puropus too but it doesnt work also. so what i am doing wrong?[/quote:1or7j8em]

You would add the Trigger once condition after the other conditions. A subevent would also work. So from what you're telling me it doesn't seem like you're making an obvious mistake. Maybe share a cap or show at least a picture of the event.

[quote="irbis":1or7j8em]also how do i.... emmm. loop commands? i mean more like - "how do i point which commands should be looped"?[/quote:1or7j8em]

When I mentioned looping your sound I was actually referring to this:

B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest