No Audio on Device

For some reason audio is working perfectly fine on the simulator but when I load it on my device I get nothing, all volumes are turned up.

Same here.. tried a lot of things.. renaming the audiofiles.. converting to different sound formats..

Just tried converting it to an ogg to no avail. Just got a response here, http://developer.anscamobile.com/reference/index/audioplay#comment-15686 Only wav is supported on Android right now

Interesting; .ogg works on an Android soundboard I built 3 days ago, just not in the simulator :S I guess I should convert to .wav, then.

I just put sound into my Android App but I found that I had to use .wav files and I had to put them in the main resource directory and not a sub-folder.

Just my $.02.

I have tried many samples and simple modified samples too, but none of them are producing sound at all on Nexus One. Does not matter whether this is openAL based or the basic media functions.

These are being built on Windows. The sounds play in the simulator with no problems.
Sounds are .wav files
Sounds are just in the main directory, no sub folders are used in these samples at all.

I have noticed that other apps built with Corona can produce sound. Eg. Bubble Ball. So it seems to be possible.

Any Ideas??

I found that the .WAV files need to have an Audio Bit Rate higher than 176,400 --- anything less will not play.

I have some example files that I could send to you to test if you like --- just let me know.

That would be great. just one file that you know works would be ok.
(address removed)

Thanks a lot for the assistance.
Just so others reading know. This still did not produce any sound on the Nexus One. I don't know if it is limited to the Nexus One.. So maybe I should just say this is not producing any sound on Android devices.

I have tried both of these.
local knockSound = audio.loadSound("sfxbuzzerlong.wav")
audio.play( knockSound )

and

local knockSound = media.newEventSound( "sfxbuzzerlong.wav")
media.playSound( knockSound )

I have tried to target build as 2.2 and 2.0.1
No sound on any of these.

I am using the Windows version of Corona. Perhaps it is the problem?
Anyone else noticed this?
Should I report a bug?

Ben

Can I suggest using something other than WAV? I've always had issues with WAVs in Android builds. (I use mp3 or ogg.)

I don't use Windows but yeah, that's been my experience. Perhaps test with a different format just to troubleshoot it?

Thanks for the suggestion.

I just built the plain vanilla web overlay sample (probably again, but I did it to be sure) which uses an mp3. Still no sound.

I have sent a bug report now. It may very well be just a Windows version thing.. I may try it later tonight on the Mac version to see for sure.

Thanks guys.

Good luck - sorry to hear that it still isn't working. :(

I am experiencing the same thing. I am using a wav file, in the main directory, bitrate of 352 kbps, and still no sound on my Samsung Captivate (2.2). I hear it just fine in the simulator.

- Aaron

@arog... Was you test built with the Windows version too?

@BenM Yes, on Windows. I can setup a Mac tomorrow morning and try it there.

- Aaron

Just to save anybody additional effort, we confirmed that Android device builds built via Windows are not properly copying in the audio assets. Mac builds are unaffected. We will continue to investigate this.

OK.. It is officially a BUG now..

I have just built the same sample code up on the Mac version and the sound is playing on the Nexus with no problem.. So you can stop looking, or pulling hair out.

It is to be expected that the new Windows platform has a few issues. But at least we now know this is one of them, so you can stop wondering whether it is a coding thing.

(edit).. beat me by seconds.. I had just confirmed it here.. hahaha

Glad to hear it is now a known bug; and that I can build with Mac if I really need to. I just started using Corona last week so I'm still figuring everything out and am in no hurry. :)

- Aaron

FWIW in our internal tracking this is issue #3164.

OS builds have the same result. I've had success avoiding the Audio libraries (which use the openal) and instead using the legacy Multimedia api calls.

Also, I noticed this as one of the comments by ewing when the openal libraries were announced: "I can’t say if Ogg Vorbis will make our first release, but it is important to us."

Was Ogg format ever supported by the audio calls?

Ogg was available on Mac and Windows, but not iOS or Android.
I pushed in Ogg and MP3 today for Android. It is expected to appear in our first public daily build. We have no plans to include Ogg on iOS due to size, performance, and battery concerns on iOS.

Hi ewing,
is MP3 support now available for Android builds with the current daily build?
And when will it be ready with the public builds?

MP3 and Ogg support was added to Android and is available starting with the very first daily build.
I do not know yet when the next public build will be released.

audio.play() doesn't work with MP3 on Android, only uncompressed WAV works.

Thanks for your response, ewing.

aguierri: Are you talking about v 268?

@benlebt yes, downloaded the SDK v268 hours ago and tried on a brand new Nexus S. For example, MP3 works on the simulator but doesn't on the device. Using WAV solves the problem.

OK then. As ewing wrote above, it works in the daily builds (which you receive when you pay for a subscription) and will be rolled out to all with the next public release.

So is it not ok to use .ogg files for iOS builds? I have an event sound that is 8k as .ogg versus 45 k as an aif.

Anyone got the official state of play for audio on Android built on Windows....Ansca?
Does it work, what format should be used.
Be good to get an official line on this to save waste of time

Cheers

According to the release notes for the latest Windows build this should now work. I will test it out shortly with my 352 kbps .wav file that does work in the OSX version of the SDK.

https://developer.anscamobile.com/downloads/coronasdk#windows-release-notes

- Aaron

Hello arog
So have you tested it? what are the results? I've tried to build my app with mp3-s for Android in debug mode but still no sound. I'm using audio.play() and other stuff.

Audio fails on my device with build Corona.2011.312 , but works fine on release 268. So I went back to that

So there is no ANY way to have audio on Android device - audio., media., mp3-s, wav-s, Win or Mac - anything?

Audio is supposed to work. Please try the latest daily build (~317). There were some fixes that affected file packaging on Android.

Hi ewing
For Mac I can see only build 268 here - https://developer.anscamobile.com/downloads/coronasdk. For Win I'm using build 377 but I have the same issue - no sound.

I think audio is supposed to generally work in the latest Windows build, though it doesn't have all our fixes found in 317.

Make sure you use flat file hierarchies for now. (Might be fixed in 317.)

For .wav, make sure you use uncompressed linear PCM, 16-bit integer, little endian.

For .mp3, the same decoder is used for Android and Windows. If the mp3 doesn't play in either, then you might have some weird .mp3 encoding which we don't support.

We don't have any guidelines on ogg right now. But keep in mind we don't support ogg on iOS, just Mac, Windows, Android.

Hmmm....seem to be going round in circles here, still no sound
Here is a simple test that works fine in the sim but nothing on the actual android

I am using the latest beta of Windows build 2011.377

Here's a bit of test code I am using

-- Load sounds
local soundID = audio.loadSound( "horn.mp3" )
playBeep = function()
audio.play( soundID )
end
playBeep()

Hello
Yes, the file hierarchy is flat. And on Win I'm using latest 377 build which is available for free download (I can't get daily builds as I'm not subscribed yet).
Regarding mp3-s encoding I'm nusre about it but I don't think there can be something special there. Can I post you one of my mp3-s so you can check and tell whether there is something wrong with this file?

Hi g.harrison
I'm experiencing the same issue.....

I'm using the latest Windows build (377) and .wav files work in the simulator and on my Samsung Captivate.

I realize there is the delay issue with audio.play() (see the Release Notes) but it doesn't bother me as I'm still in early development on my app/game.

1
2
local tapSound = audio.loadSound( "tapsound.wav" )
audio.play( tapSound )

Hi arog
Yes, it looks like with wav-files everything is working good. But now i'm facing other issue - I've converted some of my mp3-s tp wav-s and tried to build my app. as the result I've got a "Build failed" error message and any info in the console. I presume the problem is in my wav-s - maybe format/compression is unsupported or something like this. Is there any requirement about what compression type should be?

Make sure you don't have any files with the same basename, e.g. boom.mp3 and boom.wav. Android hates this and causes builds to mysteriously fail.

Hi ewing
Thank you for this tip - I'll check it right now

I've checked it once again: mp3-s removed from the folder, only wav-s are their - build failed. Any suggestions what could it be?
P.S. Ansca guys, please do something with the sound on Android - at least make it working with mp3-s, please!!!

If the build fails, that is not a sound problem...that is a build problem.

Make sure you don't have any other duplicate resource files, e.g. images.

MP3s should work. I recommend you start small with a simple two line project to verify.

I have .WAV and .OGG files working on Android

Two things that I found were:

- WAV files cannot be in sub-folder
- WAV files need to be at a higher bit-rate when converted or they did not work

I have not retested .MP3's since build .268 (but probably same as above where the sound files cannot be in sub-folder)

Try it and let me know. I hope it helps.

Hi ewing
It's pretty strange - I've tested mp3-s several times (BTW I'm using Cropna for Win - maybe this is the case?) and they don't work :(
But anyway i've solved the problem: I've converted all my sounds to wav-s so they dont require any codecs or anything else to play and now it works. BTW it looks like the bitrate can be any we need - I've checked even with the lowest quality and it works fine on Android.
So the problem is solved - thanks everyone! :) And waiting when mp3-s will be supported!

OK finally got some success.
Converted my mp3 to .wav file (22 16bit Stereo, PCM uncompressed)and built using version 2011.377 on windows and it works....hurrah.
There is the delay problem still but at least I now have something.
Hopefully the delay and MP3 format will be sorted soon (please Ansca :) )

g.harrison, the same issue :)
So, Ansca, desperately waiting for solutions!!

hello, the wav file is not an acceptable solution.
I have long soundtracks and, converted in wav they will be too large to work on ....
On iPhone i use mp3 format ant a soundtrack takes max 5mb. the same soundtrack keeps more than 30Mb in wav format and causes the app to crash after installation ....
Finally builds after 268 works only for version 2.2 of android ... so when a stable release will be here?

MP3 and Ogg support for Android are in the current daily builds.
The next stable release should be real soon.

views:2403 update:2011/10/8 15:12:54
corona forums © 2003-2011