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:
function room_FirstLoad()
{
aMusic1.Play(eAudioPriorityHigh, eRepeat);
}
Am I missing something? Should I check some options I don't know about?
Which version of AGS you have?
v3.4.0, downloaded pretty recently.
silly question:
did you import it into the editor via the audio tree using the music folder node?
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.
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.
aMusic1.Play()
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.
Does the music file play in the editor?
Yes, it does, in editor it works just fine.
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..
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...
check digital sound in setup is NOT set to no digital sound..
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.
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?
No, it's named "test", nothing special. All files' names are also only in latin characters.
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.
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();
I feel like a dummy now... Sorry for trouble and thanks for help!
No Worries mate, most of us have been there (laugh)
slasher