media.playSound() and media.playEventSound() in Simulator

media.playEventSound() is not working for me in the Corona Simulator with any audio file or format. Does this require a build to work?

media.playSound() is not working for me in the Corona Simulator with the audio files provided in the demos but works with other audio files. I messed around with the demo audio files to get them to work. (see below)

GettingStarted/EventSound_tests & Tutorial/HelloWorld3

  • beep.caf won’t play back in Corona Simulator
  • converting to .aif or .mp3 doesn’t help
    Fix: make the sound longer than .5 seconds (I added silence to the end of the sound in Sound Studio)
  • after fixing the sound works in all formats (.caf, .aiff, .mp3)

Device/CaptureToFile

  • CameraShutter.aiff will not play back in Corona Simulator
  • tried a minor edit in Sound Studio and resaved as .aif but still didn’t work
  • other .aif or .aiff files play back fine
    Fix: convert CameraShutter.aiff to mp3 in iTunes or Sound Studio
    [import]uid: 4605 topic_id: 463 reply_id: 300463[/import]

I’m having the opposite problem. I have my sound working fine in the simulator (mp3s 1 - 4 secs long) but they dont play on the iPhone… Any help?

pipID = media.newEventSound( “pip.mp3” )

function playPip()
media.playEventSound( pipID )
end

playPip() [import]uid: 4609 topic_id: 463 reply_id: 964[/import]

justkyle

you need to use media.playSound() for mp3’s

see page 40 of the AppProgrammingGuide.pdf

Carlos [import]uid: 24 topic_id: 463 reply_id: 965[/import]

I changed the file to the sample .caf and it works… can you not use mp3 for playEventSound? [import]uid: 4609 topic_id: 463 reply_id: 966[/import]