[SOLVED] WAV sound not playing

Started by tor.brandt, Sun 27/11/2016 11:56:53

Previous topic - Next topic

tor.brandt

I have this code:
Code: ags
function hHotspot_Interact()
{
  player.Say("Play sound.");
  aSound.Play(eAudioPriorityHigh, eOnce);
}


The sound file is imported to the Audio -> Sounds folder, and its script name is aSound.
This is the first sound file I use, so it can't be interferring with other sounds.
The Sounds folder is set to default volume 100, and aSound is set to volume -1.

The sound file plays fine in the editor, but when I run the game and perform the interaction with the hotspot, no sound is played.
The player.Say command runs fine, so the function IS called.

I have tried running game setup, and select both Default DirectSound Device and Default WaveOut Device, and then running the game.
If I select WaveOut, my speakers make a little click/pop when I start the game, but neither DirectSound nor WaveOut yield any sound.

What could be wrong?

EDIT: Okay, now I've learned the problem is related to the format of the audio file.
aSound is a WAV file. I tried importing an MP3 file, and that one works fine.
Still, I'd like to be able to use WAV files...
I tried importing the WAV file into Reaper (a sound editing application) and make a new export of it (in case there was something with the original format that made AGS unable to work with it), but it still won't play.
Any ideas?

Slasher

First off.. why on earth would you want to use .Wav files? They are larger in size then most other formats..

Personally I'd use .ogg as they are much smaller in size and their codecs are more readily supported by most media players.

Second choice would be mp3.

its quite easy to get hold of a file format changer like audacity for example.

tor.brandt

Hmmm, you're right... :-D

I guess I was thinking that AGS would somehow compress the WAV files when building the EXE, but on second thought why would it? :-X

I tried now making a new export of my sound file in OGG, and that works fine too, so I guess I'll just go with high quality OGGs then.
I'm using Reaper because I'm not just coverting formats, but also editing the sound files, as well as creating them myself from scratch.

Still, just out of curiosity, I'd like to know why it won't play WAVs, as it should be a supported format...?

Crimson Wizard

WAVs may be different. Some WAVs may even work as containers, having MP3 inside them.
I was working in a company that produced audio-editing software, and over few years we've met number of cases when certain WAVs did not play correctly in our program, or in the programs people tried to use alongside ours.

AGS is using very old sound library, which WAV support is outdated by many years. I believe that is why it cannot play some WAVs properly.

tor.brandt

Quote from: Crimson Wizard on Sun 27/11/2016 13:21:25
WAVs may be different. Some WAVs may even work as containers, having MP3 inside them.
I was working in a company that produced audio-editing software, and over few years we've met number of cases when certain WAVs did not play correctly in our program, or in the programs people tried to use alongside ours.

AGS is using very old sound library, which WAV support is outdated by many years. I believe that is why it cannot play some WAVs properly.

I see, thanks!
I'll just leave it at that then :-D

SMF spam blocked by CleanTalk