Figen Güngör
Figen Güngör

Reputation: 12579

How to play audio on Corona?

I am trying to play audio as i used to do but it seems not working now. These are the codes I tried:

  local birdSound =  audio.loadSound("bird.mp3")
  audio.play(birdSound)

It gives an error like that:

WARNING: Failed to create audio sound

Can you help me out? Thanks.

Upvotes: 0

Views: 1775

Answers (2)

Figen Güngör
Figen Güngör

Reputation: 12579

Changing the bit rate(increasing) of my files helped me to solve the problem. Thanks to SatheeshJM!

Upvotes: 0

user1607767
user1607767

Reputation: 127

  1. Don't use .mp3. .wav works for both iphone and android.
  2. Make sure the .wav file is in our folder.
  3. Sometimes some sound file can be played on computer, but not works in simulator. In that case, use other files instead.
  4. If you really like that .mp3 file and can not find .wav, find some free software to convert it.

Upvotes: 1

Related Questions