Discussion Forums  >  Audio, Video, Playing, Recording

Replies: 4    Views: 125

AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
10/23/12 05:04 AM (13 years ago)

Android Audio

I'm building an app (Apple and Android)that plays a single audio file, but the android audio is proving to be a bit of a brain-teaser! I want a page to show with a play/pause button so the user can start stop, with a progress bar on view and some descriptive. I created a page using the html5 audio component to play an mp3. All is good in IOS, but my ZTE Android smartphone (Froyo 2.2) won't play it, possibly because the html 5 audio component is only supported from Android 2.3 onwards - an up to date tablet does play, but I would like the sound to work on everything. I tried the Android audio plugin from buzztouchmods, which plays, but only to a black screen, no controls. I also tried the background audio on a custom/html page, but it wouldn't play on Android either. Has anyone done this before and if so, please let me know how?, any and all suggestions welcome. I don't mind building a different app for Android and Apple if needs. Thanks, Alan
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
10/23/12 06:27 AM (13 years ago)
Android is a pain! I've all but given up on audio. It's usually not good enough that it's a bog standard mp3 or ogg or midi or whatever. It has to be to exact specs to stand a chance. For example, mp3 should be Mono/Stereo 8-320Kbps constant (CBR) or variable bit-rate (VBR) and so on and so on. Pain in the a**! See if this helps: http://developer.android.com/guide/appendix/media-formats.html
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
10/23/12 11:35 AM (13 years ago)
Hi @raveyd and thanks, interesting link. I think my mp3 is in the right format, as it plays on my mates ice cream sandwich (what a silly nam for an OS).
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
10/23/12 11:58 AM (13 years ago)
yeah, silly name! I think the bit rate is the important bit. Newer devices can handle higher bit rates, Older os's (froyo 2.2 for example) struggle. I test on 2 devices - 2.2.1 and 4.0.1 and they're just so different in so many ways. They have very little in common. Android is a bad bad bad platform to develop cross-device apps on. still love it though!).
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
11/08/12 01:00 AM (13 years ago)
@AlanMac did you get this to work? I too am trying to get audio to play as background music for a screen but am stumped Thanks
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.