Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: AmicusDaDeer on Sun 15/10/2017 11:49:48

Title: [Solved] Audio doesn't work at all
Post by: AmicusDaDeer on Sun 15/10/2017 11:49:48
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) Select
function room_FirstLoad()
{
  aMusic1.Play(eAudioPriorityHigh, eRepeat);
}


Am I missing something? Should I check some options I don't know about?
Title: Re: Audio doesn't work at all
Post by: eri0o on Sun 15/10/2017 12:14:41
Which version of AGS you have?
Title: Re: Audio doesn't work at all
Post by: AmicusDaDeer on Sun 15/10/2017 12:18:42
v3.4.0, downloaded pretty recently.
Title: Re: Audio doesn't work at all
Post by: Slasher on Sun 15/10/2017 13:45:44
silly question:

did you import it into the editor via the audio tree using the music folder node?
Title: Re: Audio doesn't work at all
Post by: AmicusDaDeer on Sun 15/10/2017 13:57:19
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.
Title: Re: Audio doesn't work at all
Post by: Slasher on Sun 15/10/2017 14:30:17

Code (ags) Select
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) Select

aMusic1.Play()


Title: Re: Audio doesn't work at all
Post by: AmicusDaDeer on Sun 15/10/2017 14:48:57
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.
Title: Re: Audio doesn't work at all
Post by: Slasher on Sun 15/10/2017 14:57:21
Does the music file play in the editor?
Title: Re: Audio doesn't work at all
Post by: AmicusDaDeer on Sun 15/10/2017 14:59:01
Yes, it does, in editor it works just fine.
Title: Re: Audio doesn't work at all
Post by: Slasher on Sun 15/10/2017 15:02:48
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..
Title: Re: Audio doesn't work at all
Post by: 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...
Title: Re: Audio doesn't work at all
Post by: Slasher on Sun 15/10/2017 15:48:22
check digital sound in setup is NOT set to no digital sound..
Title: Re: Audio doesn't work at all
Post by: AmicusDaDeer on Sun 15/10/2017 16:11:44
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.
Title: Re: Audio doesn't work at all
Post by: Crimson Wizard on Sun 15/10/2017 16:31:41
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?
Title: Re: Audio doesn't work at all
Post by: AmicusDaDeer on Sun 15/10/2017 16:54:38
No, it's named "test", nothing special. All files' names are also only in latin characters.
Title: Re: Audio doesn't work at all
Post by: Cassiebsg on Sun 15/10/2017 20:01:48
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.
Title: Re: Audio doesn't work at all
Post by: Slasher on Sun 15/10/2017 20:41:05
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();

Title: Re: Audio doesn't work at all
Post by: AmicusDaDeer on Sun 15/10/2017 20:52:28
I feel like a dummy now... Sorry for trouble and thanks for help!
Title: Re: Audio doesn't work at all
Post by: Slasher on Sun 15/10/2017 20:53:56
No Worries mate, most of us have been there (laugh)

slasher