Playing wav files in the Android browser - android

Using the html 5 audio tag it appears it is possible to play back an mp3 through the android browser. Is it possible to do it using a wav file? If not through the audio tag is there another way to do it?

The HTML5 <audio> tag supports WAV files. Depending on your version of Android, though, it might not work in the native browser. For example, no format worked in Android 2.2. I tried it on my own phone, the Galaxy Nexus with Jelly Bean using the excellent test on Are We Playing Yet?, and found that it was not supported.
The other way to do it is to transcode your WAV file to a different format and use HTML5 audio. The Flash based WavPlayer might work too, but please remember that Flash was discontinued for Android and is not guaranteed to be installed on all devices.

android version 2.2's native browser supports ".wav" file. but android 4.0's native browser does not support ".wav" file.

Related

Videos not loading in flash CS6 published to android and iOS

I'm new to flash so I will try to write it down as clear as i can. I hope you can help me with this and thanks in advance.
I have a project that function like a brochure. Its just a compilation images, text and several videos with a very simple goto pages functions.
the images and text are already included in the fla file while the videos are in my project file directory and streamed from my local hard drive. I'm using the earlier version of flash video component and I'm using flash CS6.
My AS3 Script to load the videos
sp.source = SPContent;
sp.setSize(340, 335);
var VidBtn01 = MovieClip(sp.content).VidBtn01;
var VidBtn02 = MovieClip(sp.content).VidBtn02;
VidBtn01.addEventListener(MouseEvent.CLICK, onClick01);
VidBtn02.addEventListener(MouseEvent.CLICK, onClick02);
UNOVid.addEventListener(Event.REMOVED_FROM_STAGE, stopMovie);
function stopMovie(e:Event=null)
{
UNOVid.stop();
}
function onClick01(evt:MouseEvent):void {
UNOVid.source = "Video1.flv";
}
VidBtn01.addEventListener(MouseEvent.CLICK, onClick01);
function onClick02(evt:MouseEvent):void {
UNOVid.source = "Video2.flv";
}
VidBtn02.addEventListener(MouseEvent.CLICK, onClick02);
When test published in flash professional, the projects works really well. When Publishing for android and iOS, flash do not reveal any errors. Upon
testing the published apk and api files, then the problem arise.
Problem 1 Android: All buttons and navigation working, flash video component present but some videos canot be played.
Problem 2 iOS: All buttons and navigation working, videos not playing, cant really tell because flash video component is not being displayed.
All videos are flv 320x240 but of different duration and encoded using flash video encoder same settings. During packaging files included are the
projects swf, the flash video component's swf, the app.xml and all the videos included in the project. The .apk and .api file size is 1.02GB. I also tried
publishing without the videos just to see the file size and both the .apk and .api file is only 3.9mb. Also check the videos folder size in windows
properties, size is 1gb plus.
I checked the installed app on my iOS device using an app called iFile from cydia, all the videos are accounted for with the flash component.
For android upon checking the installed file it revealed and apk file and some .so file. You cant really see if the files are all in there. So I did a little
research and learned that if you change the .apk extension to .rar, you can extract the file in windows to inspect whats inside your published .apk
file. Upon doing sa I was able to see that all the files are accounted for.
I'm using for device testing a generic android tablet running 4.01 IceCreamSandwich and an iPad Air iOS7 jail broken.
My Question for ANDROID
How does android process the apk file, why was the apk files not extracted when installed on my device?
What might be the reason why some of the videos cannot be played? Hardware Limitation perhaps, any idea?
Will there be a conflict with the New Versions of Android (jellybean/Kitkat) since adobe flash already stopped supporting android?
My Question for iOS
Why was the Flash Video Component missing? Is this a compatibility issue with iOS since the flash video component is an swf file?
I assumed that packaging it would eliminate that issue considering that publishing air for ios includes adobe air in the package. If that's the case isthere another way to deliver the video on stage in iOS?
Is FLV video compatible with iOS if not what video compression should i use?
Lastly how can i publish to Android and iOS without the need to package it with the video. So the final .apk and .api file size is manageable.
Perhaps just adding the videos in a directory within he device's storage using the resolve path method. Can anyone share how i can do this?
Again thanks in advance to all.
I don't have time for a complete answer right now. Here's a partial answer:
You can't use .flv on iOS. You have to encode using the H.264 codec in an .mp4 file. Apple has more-or-less particular specs on the encoding. Look 'em up!
Also, in iOS you'll want to use the StageVideo class combined with the Netstream and NetConnection classes. StageVideo is a requirement for the GPU video processing on iOS devices. BUT when you're running your video code on a desktop machine, or when you're running video in AIR on desktop, you want to use the regular Video Class because you'll be rendering, usually, with the CPU. So, usually, your code will have to test for the availability of GPU processing and then invoke one function for implementing THAT, or another function if only CPU processing is available.
Video (without components -- which you should forget!) sounds complicated, but it's not THAT complicated. It just takes a little time to learn. Suggestion: study here - http://gotoandlearn.com/play.php?id=46 for the basics of the Video Class. Then read the Adobe AS3 reference on StageVideo. Then come back here and ask more questions. You'll beat your head against a wall for a day or so, but then you'll really know how to handle video on, at least some mobile devices.
When you're testing on iOS don't forget to publish with GPU rendering.
I'm just learning AIR for Android myself so can't help you there.

Sound format for mobile browser with construct 2 game engine

I am working in a project to build a game using construct 2 game engine.
The game is for mobile devices, the sound is in ogg format, I tested it in android 2.3(on a real device) and its work (big latency,but works). In iOS it is not working (iOS 5.0.1 on device and 4.3/5.1 on emulator).
I tested it in safari desktop browser -> not working, but if I change to m4a format -> it works (not in iOS)
What do I have to do to make it work in both Android and iOS.
Thank you.
To have audio play on all platforms, you need both an .m4a file and a .ogg file for each sound. For example, gunfire.m4a and gunfire.ogg.
Construct 2 automatically encodes .ogg when importing a WAV file, and will automatically encode a .m4a if you're on Windows 7. However if you're on Windows XP or Vista it won't encode this audio for you, because of licensing issues (it's not a free format). You should be able to find your own encoder though. Just encode the files yourself and import the .m4a files to Construct 2 with the same name as the corresponding .ogg. Search Google for "AAC encoder" and you should find something pretty quick.

Video tag in Html5, android

Is it possible to play a remote video which is in server using html5 in android.
I have tried playing the local video and it works fine.
Android tag support is very flanky in currently deployed phones. You can search about various problems of it here at stackoverflow.com.
I'd suggest using link to a video file on the remote server which is then opened in a standalone media player. This guarantees that the video will work on all the devices.
works fine in 2.3+ (tested personally on 2.3, 3.0, 3.1 and 3.2)
try absolute paths instead of relative paths, the type attribute should only read "video/mp4" or "video/webm" - nothing more!
check http://caniuse.com/webm and http://caniuse.com/mpeg4 for supported codecs. Ogg-Video is not supported so far.

Common audio format for Android, iOS, Windows Phone

I need to produce an audio file on an Android device that can be played on any other Android, iOS, or Windows Phone device. I need to do this without any third party apps. I am using .NET on the server, so I could convert there but I'd like to avoid that. I can see that you can record AAC in 2.3.3, but I need to use 2.2. Any ideas?
I believe the old .wav format should do the trick. It seems to be supported by both android and ios. I did not check wm7, but it is in wm6.5, so my guess is that it will be supported also:
http://developer.android.com/guide/appendix/media-formats.html
http://msdn.microsoft.com/en-us/library/cc907934.aspx
http://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/MultimediaPG/UsingAudio/UsingAudio.html
Mp3, and wav are both supported on absolutly every system, including ios, android, and windows 7 mobile. mp3 is generally used for music, but for just about anything else, it is generally standard to use wav.

Which audio format can be recorded and played back by iPhone and Android?

I am designing an app that can record short audio files on iPhone and Android that can be played back on both platforms, as well as hopefully any other smartphone.
Right now I'm using *.caf with the iLBC codec, as I know the iPhone does not encode mp3.
Is there a file format/codec that I should use in this case?
It used to be that there were no common audio encoding formats for Android and iPhone.
iPhone: iPhone audio encoding supported formats
Android: Android supported media formats
But Android 2.3.3 adds support for AMR-WB and AAC: Android Audio Encoder AAC
See Media Framework at Android 2.3.3 API changes
So I believe AAC is your format choice if you want interop between Android and iPhone devices and can handle the Android 2.3.3 limitation.
Otherwise, just pick from the list for widest coverage (AMR-NB on Android) or plan on converting the recorded audio to a suitable format.
A quick check shows that AMR is patented and I assume AAC would have some patent coverage as well. PCM is decodable on iPhone and Android and most cellphones at the expense of larger filesize.
All smartphones can play WAV files (even Android as of 2.2). These are known as "Linear PCM" in iOS and "PCM/WAVE" in Android.
Try modifying the file type in your ios version file to be .wav and you should be able to listen to this audio file on an Android phone, as well as a Windows operating system.
You'll find that mp3 has hardware decoding in all recent iOS devices and most Android mobile phones as well (but not cheap tablets, budget phones, etc).
As explained above by typo.pl, the generally compatible format is AMR or WAVE(PCM), but in practice, we prefer a progressive solution:
produce AAC on iOS and Android 2.3.3+, but fallback to produce AMR (WB)
on Android pre-2.3.3. Both formats are playable on all platforms.
I guess it's a fairly easy solution for better compatibility and audio quality.

Categories

Resources