[Solved] Audio doesn't work at all

Started by AmicusDaDeer, Sun 15/10/2017 11:49:48

Previous topic - Next topic

AmicusDaDeer

Hi,

I made a simple game, test-game in sort of ways, and I'm having trouble with playing any audio. Music doesn't work, no matter if I use OGG or MIDI files, even though "audio.vox" file compiles perfectly. I couldn't find anything about such problem in manuals, Wiki or forum, and analysing the code in "Demo Quest 3" haven't helped me much.

I'm using simple code in Room script:

Code: ags
function room_FirstLoad()
{
  aMusic1.Play(eAudioPriorityHigh, eRepeat);
}


Am I missing something? Should I check some options I don't know about?

eri0o

Which version of AGS you have?

AmicusDaDeer

v3.4.0, downloaded pretty recently.

Slasher

silly question:

did you import it into the editor via the audio tree using the music folder node?

AmicusDaDeer

Yes, I did that. While writing the code, the text editor automatically "linked" it to the name of the file I imported.

I should add that I was working on default template, not empty template, for testing purposes.

Slasher


Code: ags
function room_FirstLoad()
{
  aMusic1.Play(eAudioPriorityHigh, eRepeat); // You should not need to add last part
}


The music priority and repeat you can do in the property's panel of that file..

Music is Generally set to repeat.

Code: ags

aMusic1.Play()



AmicusDaDeer

Okay, thanks, but that doesn't solve the problem. Music is still not working. I also tried MP3 files and still there's no sound at all.

Slasher

Does the music file play in the editor?

AmicusDaDeer

Yes, it does, in editor it works just fine.

Slasher

#9
check that the system, music volume on control panel has not been set to 0.

just in case the game has been compromised you could make a fresh new game with default template and try music file again to see if it works..

AmicusDaDeer

Still doesn't work either way, even after reinstalling AGS. No music in any templates works, I tried with various files (including Demo Quest's MIDIs) and there's no sound at all. In Demo Quest music works just fine...

Slasher

check digital sound in setup is NOT set to no digital sound..

AmicusDaDeer

#12
It's set to Default DirectSound device. None options work, sadly. EDIT: On other computers it's the same - music doesn't work no matter what.

Crimson Wizard

Quote from: AmicusDaDeer on Sun 15/10/2017 15:29:21
Still doesn't work either way, even after reinstalling AGS. No music in any templates works, I tried with various files (including Demo Quest's MIDIs) and there's no sound at all. In Demo Quest music works just fine...

So it works in demo game project but does not work in one you created on your own...

Just a random thought, does your own game has any non-latin characters in its name?

AmicusDaDeer

No, it's named "test", nothing special. All files' names are also only in latin characters.

Cassiebsg

Can you make sure that room_FirstLoad is linked in the event pane of the room?
just click the yellow electric light-bolt button, and then you should see the name of the function, you can then click the ... button to the far right.
There are those who believe that life here began out there...

Slasher

#16
Cassiebsg

I'v seen the problem and it appears he did type it himself...

Always, always use the room properties events... // it has quite a few built-in functions

I'v just had it working ok.

Bit of a pause at the beginning but it does works..

Delete the 'on room load script' you put in yourself and use the Room properties box, it will automatically add that function to the room script where you can add aMusic1.Play();


AmicusDaDeer

I feel like a dummy now... Sorry for trouble and thanks for help!

Slasher

No Worries mate, most of us have been there (laugh)

slasher

SMF spam blocked by CleanTalk