playEventSound doesn't work in the simulator

Hi

I can’t get media.playEventSound to work in the Corona Simulator. playSound works just fine, but no matter what I try, playEventSound never plays a sound. Not even in the tutorials and code samples provived. For example, HelloWorld3 doesn’t play that beep.caf sound when I tap the button.

I have now tried this on two different Mac computers, one brand new iMac 27" and an older Mac Book Pro.

This is not the same issue as others have reported with playEventSound, since they are referring to Android publishing. This is another issue, where the simulator itself doesn’t do anything with playEventSound while playSound works.

Please let me know if this can be fixed. I love the Corona SDK and would really like to be able to finish my first game. All that’s missing is the sound. [import]uid: 9275 topic_id: 2174 reply_id: 302174[/import]

I have now tested this on a third Mac and the problem is definitely with the Corona Simulator. playEventSound simply doesn’t work on the Mac. Thought you should know that. [import]uid: 9275 topic_id: 2174 reply_id: 6518[/import]

I had this problem as well, but strangely, only with certain sounds. Some work, and others don’t. Those same sounds that don’t work, work fine on the device (and yes, all converted to IMA4). It had me baffled for a while there, until I tested it on the device. Not a huge problem for me now, but I could see how it could be if I were trying to make an in-game video using the simulator.

Thankfully, there’s Xcode simulator builds now. [import]uid: 7849 topic_id: 2174 reply_id: 6532[/import]

Thanks for your reply. Yeah, it’s not the biggest issue, but it would be nice if it worked correctly. :slight_smile: I’m thinking it should be an easy fix for the ever so talented Corona team. I’ll just have to wait and see. [import]uid: 9275 topic_id: 2174 reply_id: 6539[/import]

@jondal,

The AudioPlayer sample code shipped with Corona SDK uses playEventSound and we haven’t had any other reports of problems. This sample code works fine in the Corona Simulator. Have you tried that? If that works you should take one of the sample audio files in that project and try it in your code.

Please note that playEventSound will not play compressed audio files. I had a CAF file that wouldn’t play and when I looked at it in a audio editor program I found it was compressed. Saving the file as uncompressed audio fixed the problem.

-Tom [import]uid: 7559 topic_id: 2174 reply_id: 6563[/import]

Hi Tom

Thanks for the reply! As I stated, I’m using the sample code provided with the Corona Simulator. Specifically, I’ve tried Fishies, AudioPlayer and the HelloWorld3 tutorial. The sound from playSound works, but not from playEventSound.

I have now tried this on 3 different Mac computers, so it’s definitely not a problem with just mine.

1 x brand new iMac 27" running Snow Leopard
1 x Mac Book Pro running Snow Leopard
1 x Mac Book Pro running Leopard

None of these have the same setup, so there is no common attribute that could be failing.

So, I’m reporting this as a bug with the Corona Simulator. :slight_smile: [import]uid: 9275 topic_id: 2174 reply_id: 6601[/import]

@jondal,

That is very odd because nobody else has reported the problem (that I know of) and sound works fine on my iMac (running Leopard) and MacBook running Snow Leopard.

I will ask others in the office to try it on their Macs and if anyone reading this has a problem running the above programs (using playEventSound) in the Corona Simulator, but let us know.

I know you said the setup is different between the machines but have you installed any external software that is common on all three machines?

I believe you are having problems but we really can’t fix something we can’t reproduce.

-Tom [import]uid: 7559 topic_id: 2174 reply_id: 6606[/import]

There are some common applications installed on the machines, yes. If it helps, here’s a list:

TextMate, Google Chrome, Dropbox, Alfred, Adium, Navicat, Titanium Developer and now Corona SDK.

At first I thought my DigiDesign driver was maybe causing some sort of a conflict, but it’s not installed on all three computers.

Jon [import]uid: 9275 topic_id: 2174 reply_id: 6610[/import]

Jon,

Just curious, does it matter which sound file format you use with playEventSound()? For instance, try swapping media.playEventSound( “beep.caf” ) with an MP3 version (there’s one in the EventSound sample folder, I believe). From the anecdotal evidence it seems that CAF files might not be playing on your system?

Tim [import]uid: 8196 topic_id: 2174 reply_id: 6612[/import]

This may be something. I checked in System Preference -> Sound -> Sound Effects, and there are two volume sliders. One for Alert and one for Output. In Corona Simulator the playEventSound uses Alert volume and playSound uses Output volume. Please check to see that the Alert Volume slider is all the way to the right. Also make sure that the “Play user interface sound effects” box is checked on the same page.

-Tom [import]uid: 7559 topic_id: 2174 reply_id: 6613[/import]

You guys are geniuses!

You know what it was? None of the three computers had “Play user interface sound effects” checked in System Preferences. I checked it and voila! playEventSound works like a charm! Thank you. :slight_smile:

And by the way, Corona SDK is the best thing to happen to mobile development yet. After only a few days of working with it and I’m sold. Excellent work! Bye, bye Titanium. [import]uid: 9275 topic_id: 2174 reply_id: 6616[/import]

I’m glad the mystery is solved.

-Tom [import]uid: 7559 topic_id: 2174 reply_id: 6747[/import]

Hi, I’m new to corona … I’ve having same issue. All hardware things has been checked properly. Does corona support play audio in simulator mode?

I’m simply trying to make a simple application - play and stop steaming mp3 file. I don’t here any sound when I use the audio.play method.

[code]
require “ui”

local background=display.newImage(“background.jpg”)
local logo=display.newImage(“logo.png”)
logo.x = display.contentWidth * 0.5
logo.y = 90

local button2 = ui.newButton{
default = “button_listen.jpg”,
over = “button_listen_over.jpg”,
}
button2:setReferencePoint(display.CenterReferencePoint)
button2.x = display.contentWidth * 0.5
button2.y = 800

function button2:tap(e)
radio=audio.loadStream(“http://www.xxxxxx.com/stream”)
audio.play(radio,{onComplete=completed})
end

button2:addEventListener(“tap”, button2)
[/code] [import]uid: 24710 topic_id: 2174 reply_id: 17886[/import]

Sorry, the audio engine only supports local files, not files over the network. The term “stream” means to read the file in small chunks at a time. It does not necessarily mean network.
[import]uid: 7563 topic_id: 2174 reply_id: 18404[/import]

Thanks for the reply. I gave up with Corona.

Good luck!!

Regards
[import]uid: 24710 topic_id: 2174 reply_id: 18528[/import]

Hi Tom.

I’ve a wierd problem here with the playEventSound(…) and the callbacks for playSound(…) and timer.performWithDelay(…). I’m using the emulator on windows machine with trial version.

The playEventSound just plays a single time. If I want to play it again, i´ve to recreate the sound, what is bad due to device ‘hicups’.

The callbacks for playSound(…) and timer.performWithDelay(…) never happens. I tried a lot of workarounds on the code without success.

Could you please give me any hints to solve those questions?

Thanks in advance. [import]uid: 32589 topic_id: 2174 reply_id: 21507[/import]

@easy
The problems you mention are in the current Windows build. We have a fix that should be available in the next release. [import]uid: 7559 topic_id: 2174 reply_id: 21523[/import]

Thanks for the reply. In fact when we made the build for the android, everything went just fine.

Congratulations for the Corona Platform. It’s amazing! [import]uid: 32589 topic_id: 2174 reply_id: 21710[/import]