Atrag
Atrag

Reputation: 743

Failed to Create Sound

Very simple issue but I have no idea if anyone can help me with it. Perhaps it is a bug? I simply want to load this order but get the warning that WARNING: C:\Users\Usuario\Documents\Corona Projects\BalloonTap\game.lua:259: audio.loadSound() failed to create sound 'audio/pop.wav´.

The directory of the audio of the audio file is C:\Users\Usuario\Documents\Corona Projects\BalloonTap\audio

The code is:

balloonPop = audio.loadSound( "audio/pop.wav")

Any possible fixes? I have tried different audio files and renaming file. I have tried putting it in the main folder and just saying balloonPop = audio.loadSound( "pop.wav") but that fails as well.

Upvotes: 1

Views: 692

Answers (1)

GoojajiGreg
GoojajiGreg

Reputation: 1183

When sounds are not loading in Corona, it is a good idea to check that the file can be found:

local filename = "audio/pop.wav"
if system.pathForFile( filename , system.ResourceDirectory ) == nil then
    print("WARNING: cannot find audio file "..filename )
end

The fact that the sound could not be created suggests, however, that this is not the problem. From the Audio Usage/Functions Guide:

Cross-platform .wav files must be 16-bit uncompressed.

Is your sound file in the correct format?

Upvotes: 1

Related Questions