Custom fonts and sounds not playing on android

I’m trying to build my working app inside corona cards and noticed that no matter what I do I can’t get custom fonts or audio to play. 

For the audio I’ve loading it in like so

audio.play(audio.loadSound("sounds/mysound.mp3"), { channel=1, loops=-1 })

From what I’ve read the audio library should be working correct? If I build this same corona app outside of corona cards the audio works just fine. What could I be missing? I’ve tried removing it from the sounds directory and placing it in the root and still nothing.

As for the custom fonts I have the fonts in my root corona directory and once again it works just fine outside of corona cards. Once I build with corona cards though the custom fonts no longer work. Is there something I’m missing here as well?

Logcat produces no errors or warnings for either of these issues. It doesn’t cause the app to crash or anything. It seems as though corona just dismisses the call or something. 

Please try putting the audio file into the root folder.  There seems to be an issue right now with subfolders.

Yeah I was the one having issues loading the scnes from subfolders. I tried to place the audio in the root of the corona directory and it still didn’t seem to work. The fonts are also in the root directory already. I will try the sounds again by placing them in the root.

Yeah just tried it again and nothing. No sound no fonts. I even removed everything from my main.lua except the audio call in which the mp3 was in the root of my corona directory and it still didn’t play. 

Please try putting the audio file into the root folder.  There seems to be an issue right now with subfolders.

Yeah I was the one having issues loading the scnes from subfolders. I tried to place the audio in the root of the corona directory and it still didn’t seem to work. The fonts are also in the root directory already. I will try the sounds again by placing them in the root.

Yeah just tried it again and nothing. No sound no fonts. I even removed everything from my main.lua except the audio call in which the mp3 was in the root of my corona directory and it still didn’t play. 

Has anyone gotten custom fonts to work on Android? I put my .ttf files in my root folder (along side main.lua) just like in regular Corona, but that’s not working.  Getting this in my logcat:

10-30 02:13:58.144: I/System.out(10966): WARNING: Could not load font _font_Oregano. Using default.

The same exact code works in regular Corona.

Nope custom fonts will not work for me at all.

Hi @poon, @dmglakewood,

I assume that you carefully followed the tutorial on custom fonts? Have you tried more than one custom font? Sometimes a particular font or font file simply has issues, even if you follow the inclusion steps exactly.

http://coronalabs.com/blog/2013/01/16/faq-wednesday-custom-fonts/

Brent

Yes, I’ve successfully used custom fonts a lot in regular Corona for Android, and the exact code that is not working in Corona Cards is *working* in Corona.

Yeah, I have no problem using custom fonts except when it comes to corona cards. In fact I gave up on corona cards in general. Too many bugs and no one really seems to care about them. I reported this custom font bug months and months ago and it hasn’t been fixed. I also reported that you can’t require a file unless it’s in the root directory. So if you want to do require(“script.somefile”) it will fail to load the file. Once again filed months ago and still broken. Corona cards seems like a good idea gone bad. It’s advertised as just “drop your corona code in” and it will work, but I only found that to be true if you have a very very basic app and even then it still struggles. The windows corona cards is a little better but still very buggy in many ways. 

This is a bug we’re going to have to fix but a work around right now is to append the folder name to before the font name.  For example if you project structure looks like:

assets

  Fishies

    - main.lua

    - whatever.ttf

Then in your main.lua you want to create the new text like so: 

local myText1 = display.newText( “This is text”, 300, 300, “Fishies/whatever”, 60 )

I can confirm that the workaround works, though I did it differently.  I just moved my .ttf files into the assets directory rather than keeping them alongside my main.lua.

@dmglakewood - I would recommend you give Corona Cards another try. When I first tried Corona Cards, I found it buggy too, but things have gotten much better. I’m still awaiting a show-stopping bug fix regarding hardware buttons, but it’s much, much better than it was even just 2 weeks ago. I plan to release it in a large production app soon.

Has anyone gotten custom fonts to work on Android? I put my .ttf files in my root folder (along side main.lua) just like in regular Corona, but that’s not working.  Getting this in my logcat:

10-30 02:13:58.144: I/System.out(10966): WARNING: Could not load font _font_Oregano. Using default.

The same exact code works in regular Corona.

Nope custom fonts will not work for me at all.

Hi @poon, @dmglakewood,

I assume that you carefully followed the tutorial on custom fonts? Have you tried more than one custom font? Sometimes a particular font or font file simply has issues, even if you follow the inclusion steps exactly.

http://coronalabs.com/blog/2013/01/16/faq-wednesday-custom-fonts/

Brent

Yes, I’ve successfully used custom fonts a lot in regular Corona for Android, and the exact code that is not working in Corona Cards is *working* in Corona.

Yeah, I have no problem using custom fonts except when it comes to corona cards. In fact I gave up on corona cards in general. Too many bugs and no one really seems to care about them. I reported this custom font bug months and months ago and it hasn’t been fixed. I also reported that you can’t require a file unless it’s in the root directory. So if you want to do require(“script.somefile”) it will fail to load the file. Once again filed months ago and still broken. Corona cards seems like a good idea gone bad. It’s advertised as just “drop your corona code in” and it will work, but I only found that to be true if you have a very very basic app and even then it still struggles. The windows corona cards is a little better but still very buggy in many ways.