How to add small sound clip to app? - G1 Apps and Games

I'm writing an app in which when a button is clicked I want a small sound clip to be played. There will be about 10 different clips and this will all be done in the onClick().
What's the simplest way to do this? I see tons of code out there (on here, google, etc) for this but it all seems to revolve around music players.

I found a good way to do this but running into problems...
I put s1.mp3 into the res/raw folder and rand this code.
Code:
MediaPlayer mp = MediaPlayer.create(getBaseContext(), R.raw.s1);
mp.start();
It works great on the emulator, but after about 7 runs of it on my phone it force closes. Any help? I think it's running out of memory.

Related

Video Recording

Video recording app now in the market, tested and works ok overall but no sound. To stop recording hit back button. Very buggy!!
watts da name of it
yeah it's working well.
very, very buggy mind you, alot of force closing but, hey, it works i suppose.
quality's not too bad but it's really slow, so as long as you keep still it works fine
i'll get a little video uploaded to show you.
illrific said:
watts da name of it
Click to expand...
Click to collapse
Video Recorder/Video Camera
can anyone find where it is on the sdcard and here is more info[URL="]http://www.android7.org/forum/viewtopic.php?f=10&t=5[/URL]
santaninja said:
can anyone find where it is on the sdcard and here is more infohttp://www.android7.org/forum/viewtopic.php?f=10&t=5
Click to expand...
Click to collapse
Been trying to find it myself, all it has in the program file is a bunch of blank pics! Man its a start but buggy as hell!!!
on the website it says there's gonna be an update in the next 2-5 days so lets hope the bugs get ironed out. also i'd quite like to see more stable recording and sound
but maybe i'm asking too much
Interesting. Pity about the bugs and no sound, but it's a start, which is very good.
Good start. Bring on the updates.
Keeps asking to update! very annoyin
i saw this app today, for some reason decided not to download it
but its a "good" start
hope to see this being updated constantly.
How could u not even try it out .
I grabbed it as soon as physically possible.
It needs a lot of work.
And yes, MJPEG
Really needs some work haha.
EDIT: I just realized that my post has a lot of smilies
Update Released!
New update with a much cleaner interface. The videos are stored(i use this loosely) onto the sd card in /.org.android7/videorecorder. Uses about 16m for 10 seconds of video. The audio works as long as you also have the VoiceClient installed, it's not very loud but it's there.
After opening the app press record to open the recorder window(your not recording yet) hit menu-record to record and the same to stop recording.
I'm curious how the recording is working? It would be nice to at least be able to re-assemble the recordings on my machine.
In the video folder there are two file types blah.3gp [16kb] (appears to only be the audio) and a group of blah.jpg [~225kb] images (tho these are not viewable even on my pc?) any ideas?
The videos it makes are not viewable on any of the other viewers on android either. (the only thing it's really missing)
Well, it seems to get better with updates.
2 things i realized...
1) When you replay a video after you record it, it plays like its on fast-foward or 2x.
2) If you delete a video from your phone, the video gets deleted(Why is 30 seconds of recording 32 Megs by the way?) BUT the audio files from the video(which the file type is .jpg also, weird?)stays in the anroid7.org folder so they never really delete, you have to manually go in there and delete them when you USB to your comp.
Either way, i consider the effort and applaud him for the first video recording app of its kind on the android OS, i see potential in the future.
built-in video player?
I'm confused.. I know g1 doesnt have a built-in icon for video player but i just noticed that i can open a video file using an astro file manager (unless astro has a video player itself).. it has an auto-rotate function too and looks like the Video Player in the Market.. hhmm.. And currently, I dont have any video player program installed in my G1... Can someone clarify this?
Ya, I've tried rebuilding the 'video' into something useful. The Audio file name is xxxxx.jpg.3gp (amr i believe) and the images 225k each ~2/sec don't appear to actually be .jpg, nor can i get them open with .gif .bmp .jpeg .png as extensions
this is on windows, maybe they'll turn up something more promising on *nix.
I quit testing this.
It's not encoding nothing only take fast pics and save de audio on 3gp format.
It's good to see that we can take pcitures so fast because this show us the real posibilities with this cam on HTC G1.
Google has to build something using the internal h264 posibilities of decode/encode(i guess) to encode the pics and audio on real time(too heavy processing ?)
Till that time....just wait and see
It CAN.
WinMo guys did.
Prove me wrong.
HTC Touch Diamond T-mobile G1
Main specs:
Qualcomm MSM7201 CPU Qualcomm MSM7201 CPU
192 MB of RAM 192 MB of RAM
3.2 MP Camera, no flash 3.2 MP Camera, no flash
OS: WinMo OS: Google Android
Videorecording:
352x288x30fps None.
So:
1) It is definately technically possible.
2) Hey, WinMo does Android, the open source, WTF???
Where's Our Video Player?
Does anyone remember TCPMP / Core Player on WinMo?
Why can't we have that satisfaction on our G1's???
Is it the hardware-decoder thing? Is it OTW?
Anyone know what's up?
There is a video player, It's called Video Player....

best mp3 player

hello there, i just bought an X1 and was trying to find the best mp3 player. the ones i found on the phone were very slow. i have an 8 gb card with 1400 songs on it.
i need a player that doesn't have a delay between changing the songs and also a search function.
i found winamp for WM; i runs smoothly but i couldn't find the jump button.
any ideas ?
there are plenty...pocket player, imulator, s2p, lcg jukebox...
imo, pocket player is better choice, but it is not free
I also recommend Pocket Player by Conduits. Not free but the best player I have seen so far.
thanks man, i found pocket player, it's nice, but it's so slow . i'm having so many problems with this thingy, i can't even find the gps menu in settings
I dont consider Pocket Player slow. Its not lightning fast, ok. But slow?
Concerning gps setting: You will find them under settings\system\external gps
Another vote for Conduits Pocket Player. Not slow at all, slides and performs as expected. I had been a satisfied user for many years and had it running on all of my WM devices with no issues, and we are talking a far less spec-ed ones than Xperia. The best part for me is that it sends music over the bluetooth to a mono headset and with tweaks can be set up as a default media player for Voice Command, which means it gets controlled through bluetooth as well. Can't beat that.
mishick said:
hello there, i just bought an X1 and was trying to find the best mp3 player. the ones i found on the phone were very slow. i have an 8 gb card with 1400 songs on it.
i need a player that doesn't have a delay between changing the songs and also a search function.
i found winamp for WM; i runs smoothly but i couldn't find the jump button.
any ideas ?
Click to expand...
Click to collapse
With Pocket Player you can set up the interval between songs, even fading of one song into another.
mishick said:
thanks man, i found pocket player, it's nice, but it's so slow . i'm having so many problems with this thingy, i can't even find the gps menu in settings
Click to expand...
Click to collapse
I wonder if slowness is caused by your card read rates...
yeah, my card is probably slow, but this doesn't change the fact that pocket player has a not so nice search function. after you find the desired track, it replaces the playlist and you have to go back each and every time.
have you tried that winamp version for WM ? if i could find the "jump" button. it really looks like winamp and it's veeeery fast.
ps: i'm using the same micro sd on an n95 and it works like a charm, i'll try and update the x1 to 6.5; if i'm not satisfied with the results, i'll swap it for an n97.
It's a question of configuration. In advanced settings you can choose whether to generally replace the current playlist or to enqueue an opened file. What's more it is important to choose the correct method. If you want to replace the current playlist you choose open\open file but if you'd like to enqueue you have to use open\add file. It's the same in the library. When you press on an album, artist or track in the list a menu pops up and you can choose between play (replaces current playlist) or enqueue. In the library there are settings too. There you can once again choose between different ways the program interprets gestures/ actions. So all in all what you describe is a mere question of configuration and using the correct method
i've given up. i tried saving a playlist and it freezed my phone (twice). i don't care anymore.
now...this is WINDOWS mobile, right? on my p990 i had an emulator for old nintendo games (mortal kombat, street fighter etc); is there such thing?
what other games do you know? i saw a video, someone was playing tony hawk, i'm looking for something similar with good graphics and interesting gameplay, perhaps a football game, pool, bowling...
Perhaps... the problem is with your device.... I can't say I ever had any problems of any kind running Pocket Player, saving playlists, selecting songs, scrolling through lists etc, and I used it on quite a few WM devices so far. Can't even say the performance was ever affected by the ROM or specifications. It runs equally well on 200Mhz devices and 620Mhz devices, with 64Mb RAM and 256Mb. It even runs perfectly well on LG KS20 and that little bugger has many problems. I have it on my Xperia, needless to say.
FYI: I realise that you asked for a new media player, but I thought it was worth mentioning that both the X1s built-in meda players have a highly elegant quick search as you type feature.... just start typing..
sonus said:
FYI: I realise that you asked for a new media player, but I thought it was worth mentioning that both the X1s built-in meda players have a highly elegant quick search as you type feature.... just start typing..
Click to expand...
Click to collapse
if you have more than 1 song that starts with "mar" for example, it will only show you the first one
what's so elegant if it doesn't satisfy my needs? btw, where's the equalizer on these so sweet and neat "media" players? even with the players that have equalizer, the sound sucks in my car/headsets comparing to nokia.
i'm sorry to say this, i love ericsson, but i regret buying xperia.
Look it is clearly visible that you don't now how to use Pocket Player. You say: "This does not work, that is not possible". But everything you mentioned so far is possible with Pocket Player as long as you know how to use it.
Concerning your problem with playlists I cant confirm that the Xperia crashes when saving a playlist. Have you tried saving in another format?
If you don't like Pocket Player there are other solutions. Pocket Music by Pocketmind for example or Mortplayer. Both come with an equaliser but for me Pocket Player is by far the best program available.
AS for games you can get warcraft 2 and starcraft and heaps of other games.
hey, i have the best solution: throw away this crap and buy the goddamn ugly n97,
this morning i was trying to send an sms to a bunch of my friends and, surprise, i can't mark recipients, i have to select them 1 by 1. YEAH XPERIA ALL THE WAAAY
Look I found in 5 minutes by using the search function what you say is not possible.
http://forum.xda-developers.com/showthread.php?t=354164
Search also for the keyword "power sms" as this is another solution. Maybe there is even more software available here at XDA. Generally everything is possible with Windows Mobile because there is software for almost any function you can imagine. So please either start using your brain or stop annoying us with your false statements. I don't care if you believe Xperia X1 is crap and N97 is better but stop claiming things that are just plain wrong only because you are to lazy to look for a solution yourself.
for me nitrogen is the best mp3 player for winmo.
so i have to install a third party software to send a lousy sms? if i wanna send a message to 1 guy, i use it's default app and if i wanna send one to many, the other one. i can't believe this. yes, i'm slothful, that's why i bought a smartphone
oh, btw, sometimes, it doesn't show the number that's callin' me so i have to restart it...
i have nothing against xperia or WM, i'm just being objective here, but imagine if i would have had to pay for all these extra applications? imagine if i didn't know my way around technology. i would want my SMAAARTPHONE to do everything by default; and by everything, i mean the basics.
you guys know better than me that many 3rd party apps are ****ed up and buggy and laggy, and trust me, i had more than 10 symbian phones, i know what i'm talking about. so don't you dare jump on me with "use your brain, false statements". maybe i do have a cheap micro sd, but why does the old n95 work so smooth with it a?
altae, i dare you to show me a video of you using pocket player. i want you to load a playlist with at least a couple of hundred songs, i want you to have there songs that have the same title such as come(ing) undone by placebo, korn and robbie williams. search for "undone", let me see how it shows you all 3 songs and after you select one, the playlist goes on just like "good ol' winamp". if you can do that and i can't, i swear i'll hit myself as hard as i can with the x1 in the head, in my nuts or wherever you want me to.

[Q] Media (audio) player

Can anyone recommend an audio player that is better than the SE one?
Happy to pay if it's worth it.
The one thing I do like on the X2 is it's ability to store a bunch of my CDs so I can play them.
I just wish the media player was a bit better:
- bigger pic of the CD cover would be nice
- more info about the CD (e.g. year released)
- better info on tracks (if the track is from a various artists CD let me see which artist the track is by)
That's all I can think of right now.
Thanks.
winamp for ppc perhaps
i think its called WinamPAQ
john3136 said:
Can anyone recommend an audio player that is better than the SE one?
Happy to pay if it's worth it.
The one thing I do like on the X2 is it's ability to store a bunch of my CDs so I can play them.
I just wish the media player was a bit better:
- bigger pic of the CD cover would be nice
- more info about the CD (e.g. year released)
- better info on tracks (if the track is from a various artists CD let me see which artist the track is by)
That's all I can think of right now.
Thanks.
Click to expand...
Click to collapse
Nitrogen is a freeware player which isn't bad & has an EQ & is skinable. Now, Pocket Player is (IMHO) the absolute BEST player on Windows Mobile. It has an EQ & ability to do 'full-screen' Album covers. The only caveat: they are NOT on Windows Marketplace, and if you have to reset the phone & reinstall, you're going to have to beg them for another key. (I *HATE* that kind of crap, and I've gotten to the point where I go out of my way to AVOID anything that's not on Marketplace. Also, Marketplace lets you download on up to 5 devices, ...so for me: I don't have to re-buy all the stuff I bought on the X1 for my X2.)
Please AVOID at all costs the Kinoma (payware) player. Although it looks like you're getting a great bargain, it has a default setting to always "search the entire phone" for new content. And, even if you turn that off, every now-and-then it loses its cookies and forces you to unexpectedly re-catalog the entire phone (usually, when you MOST want to 'just listen to music').
PocketMusic is another freeware player, that supposedly supports WinAmp skins, and has an EQ. I found this one really flaky with a CLUNKY interface that was well-bested by Nitrogen.
...Now, after all was said-and-done, I'm back to using plain-vanilla Windows Media Player. This is for a number of reasons:
1) It's skinable, too. (Look for the toadlife_Sense25_WMP_Skin_signed.cab; it's HTC-like, but really clean)
2) It is fast at cataloging tunes, and I don't know how it does it, but doesn't take a gb or two to do it (Kinoma; I'm *****ing at you!), and it's completely at your discretion when you want to update it.
3) Album-size, while not as fancy as I'd like, is not bad.
4) Using the default X2 Saturn skin (MR2 firmware), WMP's library selection doesn't look bad (although it doesn't show album art like PocketPlayer or some others), and is fairly finger-able.
5) BOTTOM LINE: I noticed that (although it doesn't have a built-in EQ), the sound quality is actually noticeably better than Nitrogen & PocketMusic provided. It seems as if WMP engages some sort of noise-canceling when actual signal is produced. You can hear it kick-in when you hit play. And, this is not to say that dynamic range is reduced. I think it sounds better in-ear than on X1, in general, even though I was able to run the HTC EQ in the background on X1 (not compatible with X1, due to the hardware not being HTC).
For me, Slideview entirely crashes after a few mins anytime I run it. I have a 16gb card with LOTS of pictures, games, emus & music. Unfortunately, Slideview is very persistent and you can't hack the registry to limit what folders it looks in (it just HAS to look everywhere). There seems to be some files (possibly emus) that it thinks are Videos (but are not) and when it gets to refreshing them, craps out.
But, WMP works well for me. --If you can't live with it, go for PocketPlayer. I may go back to it someday, myself... but I want to be absolutely sure I won't do a full-phone-refresh someday. I've had the X2 for a little over a month, and am pretty well-settled, but ...there were a lot things I tried/uninstalled, etc. which have probably bloated my registry (I might have to break down and reload one day).

[Q] mp4 movies help?

Hey all need some help here got some mp4 movies that play till 1:11:35 then the video stops but the audio keeps playing. Btw I'm running cm6 black mod stable. Any suggestions?
There's alot of info missing in your post, such as the player you're using and how did you encode your movies. This makes it hard to find a solution to your problem.
I think I had the same issue for a period, but switching players helped. Though I don't recollect exactly. Here's a quick tutorial I put together awhile ago: http://digitaldeverell.com/?page_id=130
Maybe that could help???
Not sure of the encoding, I downloaded the videos they all play no matter what player I use but they all stop at 1 hr 11 min and 35 seconds up until then everything perfect. Could there be any kind of cap or time or MB restrictions? I work midnights with nothing really to do and would really like to watch some movies... thanks...
Oh, btw the video stops at 1:11:35 and the audio continues but when it stops the seek bar returns to the beginning of the movie. The rest of the video is there but it wont play past that time.
Are you trying to 'stream' the video? Try act1 video player ...
Sent from my HERO200 using XDA App
ive tried act 1, and several others cant remember all of them (deleted) but im not streaming them they were downloaded and work fing on my pc. Tranfered them to my sd card and played them, they all work fine... perfect audio/video until 1:11:35 and then the seek bar goes to the begining of the movie and the audio continues to play as if nothing happened. if i drag the seek bar past 1:11:35 the video is there but it plays audio from the begining of the movie...??? idk im like wtf. i thought about cutting the movies in half sumhow but dont really know how to do it. thoughts?
Well there's only so much cache room allowed, for most apps/ functions.
Is your phone rooted, and what ROM?
Sent from my HERO200 using XDA App
Yes, rooted running cm6 blackmod stable.
1:11:35
I am having the same problem here as well. I just went on a flight and encoded five different movies. One was encoded with AnyDVDconverter, the other three were done with Handbrake. The movies converted with both programs worked until 1:11:35.
I have tried a lot of different settings within each program every time with the same results, audio continues and the video pauses. If I seek past 1:11:35 the video will play, but the audio begins to play from the beginning with the slider bar returning to the start as well.
See how this appears to be an issue with the phone and not Handbrake, I wiped and flashed CM6.1 with the same results.
Any thoughts on what else could be done to have proper video playback.
Also, I have tried the Gallery, mVideoPlayer, and DoubleTwist with same results as well.
Thank You for any suggestions.
Solved:
found this solution in the CyanogenMod google code website, sorry I can not post the link
I solved the problem by executing the steps below:
1) adb pull /system/build.prop build.prop
2) open the retrieved build.prop file in your favourite text editor and change
media.stagefright.enable-player=true
into
media.stagefright.enable-player=false
3) adb remount
4) adb push build.prop /system/build.prop
5) adb shell reboot
After applying this fix, I have not noticed any problems with youtube playback.
Click to expand...
Click to collapse
Hope this helps someone else out too.
That didn't fix it... From what I've found the files have to be less than 2mb due to SD card fat32 partitions limits. Irk.
Sent from my HTC Hero CDMA using XDA App
I had the same problem but couldn't find any solution on the net anywhere. There IS a simple, yet unelegant solution though:
Split the movie into 2 (or 3 if it's a very long movie) files.
In Handbrake, look at the total number of chapters. Do one pass for the first half, then another for the second half (ex, 24 chapter total, then do one file with chapters 1-12 and a second file with 13-24). Just name the movies "Title 1" and "Title 2".
Voila. Problem solved.
-Oz

Windows Phone 8 questions

Based on what I've seen today it still has no:
- system dictionary for definition lookup(only for predictive text). The Kindle App does nothing when I press & hold on a word, unlike on my iOS device.
- hi-speed media scrubber for music. you know the little round knob on the progress bar that allows you to move the time index to any point in a song or video.
- unified search aka Local Search(apps, music, videos, contacts, emails)
The music app is pretty bad. I had several attempts to build a proper one, but the developer can not interact with the music library, other than playing existing playlists or songs.
You can't make custom playlists(actually you can, but it very, very, VERY complicated and prone to error and simply does not worth the shot), change the order of music inside the list and stuff like that for a third party app, and that sucks.
There are no new APIs for XNA (which is used to access the songs in the phone) so there is no way of making one.
If there is something I can say it is not right on WP, that's the music app.
mcosmin222 said:
The music app is pretty bad. I had several attempts to build a proper one, but the developer can not interact with the music library, other than playing existing playlists or songs.
You can't make custom playlists(actually you can, but it very, very, VERY complicated and prone to error and simply does not worth the shot), change the order of music inside the list and stuff like that for a third party app, and that sucks.
There are no new APIs for XNA (which is used to access the songs in the phone) so there is no way of making one.
If there is something I can say it is not right on WP, that's the music app.
Click to expand...
Click to collapse
Does that imply that there´s the same limitation for video? ...and ...as a result of that a videoplayer with support for more codecs is very unlikely to ever happen?
TarKin said:
Does that imply that there´s the same limitation for video? ...and ...as a result of that a videoplayer with support for more codecs is very unlikely to ever happen?
Click to expand...
Click to collapse
The File-Assosciation feature in WP8 works like this. Your App can define certain file endings (e.g. .mkv) which it can handle. If those are found on a SD-Card or downloaded the according registered App is then started for those files. The App can then do whatever it is it does as long as it keeps to reading the file (the original can't be manipulated although the app could copy it into it's isolated storage and manipulate it their). But there is one Caveat - there are several file extensions that are reserved for the OS which means that 3rd party Apps can't register for them. One of them is .mp3. Avi is another one of those (you can look them up in MSDN).
.mkv on the other hand is an extension that Windows Phone itself does not know so people could build Apps that would be able to consume them. Given that we now have Native Code capabilities writing a decoder or recompiling one written for another platform is possible, though it remains to be seen wether anyone will put the effort into it.
StevieBallz said:
The File-Assosciation feature in WP8 works like this. Your App can define certain file endings (e.g. .mkv) which it can handle. If those are found on a SD-Card or downloaded the according registered App is then started for those files. The App can then do whatever it is it does as long as it keeps to reading the file (the original can't be manipulated although the app could copy it into it's isolated storage and manipulate it their). But there is one Caveat - there are several file extensions that are reserved for the OS which means that 3rd party Apps can't register for them. One of them is .mp3. Avi is another one of those (you can look them up in MSDN).
.mkv on the other hand is an extension that Windows Phone itself does not know so people could build Apps that would be able to consume them. Given that we now have Native Code capabilities writing a decoder or recompiling one written for another platform is possible, though it remains to be seen wether anyone will put the effort into it.
Click to expand...
Click to collapse
ok. i was mainly into psp dev. before, and never had a winphone in my hands so far.
but if you say that´s possible, then i´ll go for the lumia920, reg. for a dev account and see what i can do
StevieBallz said:
The File-Assosciation feature in WP8 works like this. Your App can define certain file endings (e.g. .mkv) which it can handle. If those are found on a SD-Card or downloaded the according registered App is then started for those files. The App can then do whatever it is it does as long as it keeps to reading the file (the original can't be manipulated although the app could copy it into it's isolated storage and manipulate it their). But there is one Caveat - there are several file extensions that are reserved for the OS which means that 3rd party Apps can't register for them. One of them is .mp3. Avi is another one of those (you can look them up in MSDN).
.mkv on the other hand is an extension that Windows Phone itself does not know so people could build Apps that would be able to consume them. Given that we now have Native Code capabilities writing a decoder or recompiling one written for another platform is possible, though it remains to be seen wether anyone will put the effort into it.
Click to expand...
Click to collapse
I haven't had the chance to look over what the native code can do and what it can't do, but it is to be expected that it will have limitations, just like C# has.
You can render images (obviously) and output them using Direct3D which is pretty much what e.g. VLC does on the Desktop. You have complete read access to files on the SD-Card for your registered filetypes. MKV could be registered, MP3 or AVI could not (because they are in use by the system already).
But of course you would not be able to offload processing to the dedicated decoding units like with the built-in Codecs, which will mean more processor utilization and worse battery life. Still as a programmer I don't see too many actual road blocks (but it's a bumpy road to do this to be sure).
@TarKin: before you drop the money perhaps it would be best to start looking into the SDK. I'm not an expert in Multimedia-programming by any measure so you might be able to spot problems in there beforehand.
If you're still going for a L920 with these uncertainties for your use-case: welcome to the family, I'm anxiously awaiting mine.

Categories

Resources