Audio File for Local Notification (Argh!)

I can NOT get an audio file to play for a local notification, I only get the default sound.

I’m using an audio file that’s Linear PCM and have tried bot aiff and caf versions (converted to caf using the afconvert tool in terminal).

Does someone have an audio that’s KNOWN to work with local notifications on an iOS device that I could have to work with? I’m pretty sure my code is correct, but without a working audio file I’m not sure where the problem is.

Any hints for getting audio with local notifications working would be GREATLY appreciated!

Thanks.

 Jay

PS - Here’s the code I’m using:

local options = {alert="Yowza!", sound="alarm.caf"} system.scheduleNotification( 10, options )

The message shows, but I get only the system audio.

I do it the same way but I use an mp3, I guess you do not want to use mp3? In any case here it is: https://dl.dropboxusercontent.com/u/45955/push_sound.mp3.zip

According to all the docs I’ve read .caf and .aiff files were the only ones supported. My first try at .mp3 didn’t work so I went looking for info and “discovered” I should be using a different format.

But if MP3 works for you, well… 

Thanks for the file, I’ll give it a shot.

 Jay

Hmmm, no joy. Same thing, it just uses the default sound.

Have you tried that file on an iOS device or only with Android? 

And anyone else – any clues? The code to trigger the notification is literally those two lines I posted above. (Yes, I’ve checked the case of filename, and yes, it is in with the main.lua file.)

 Jay

It works on iOS but just now I wanted to verify Android and it doesn’t actually work, oops. Please updated thread if you figure something out.

I recommend that you use a *.wav file.  That audio format is supported on both iOS and Android.  16-bit raw PCM would be best.  And the audio file must be in the root directory of your project (ie: not in a subdirectory).

And for Google push notifications, sample project “Notifications/GooglePushNotifications” shows you how to set up your JSON to use your own local *.wav file as well… in case you’re interested.

I do it the same way but I use an mp3, I guess you do not want to use mp3? In any case here it is: https://dl.dropboxusercontent.com/u/45955/push_sound.mp3.zip

According to all the docs I’ve read .caf and .aiff files were the only ones supported. My first try at .mp3 didn’t work so I went looking for info and “discovered” I should be using a different format.

But if MP3 works for you, well… 

Thanks for the file, I’ll give it a shot.

 Jay

Hmmm, no joy. Same thing, it just uses the default sound.

Have you tried that file on an iOS device or only with Android? 

And anyone else – any clues? The code to trigger the notification is literally those two lines I posted above. (Yes, I’ve checked the case of filename, and yes, it is in with the main.lua file.)

 Jay

It works on iOS but just now I wanted to verify Android and it doesn’t actually work, oops. Please updated thread if you figure something out.

I recommend that you use a *.wav file.  That audio format is supported on both iOS and Android.  16-bit raw PCM would be best.  And the audio file must be in the root directory of your project (ie: not in a subdirectory).

And for Google push notifications, sample project “Notifications/GooglePushNotifications” shows you how to set up your JSON to use your own local *.wav file as well… in case you’re interested.