Android :: Playing Simple Sounds On Emulator
Feb 16, 2009
I am working on the Eclipse Emulator and with SDK 1.0 Release 2. What I would like to do is to play a simple C note with with code. Does android provide the necessary interface to produce such note sounds? Is there a sound library and API I can readily use on the device (and emulator)?
View 3 Replies
May 19, 2009
Unable to play youtube videos on SDK 1.5 emulator - but playing well on SDK 1.0 emulator. Can you update the source....
View 7 Replies
View Related
Nov 9, 2010
I have 5 mp3 files stored on the assets folder. The files are all 25 KB. I load the files using:
manager = context.getAssets();
this.inputStream = manager.openFd(fileName).createInputStream();
Whenever I try to play the files, the sounds are all messed up like they were mixed or something.
I've zip aligned the app already but with no results.
View 3 Replies
View Related
May 1, 2009
I have an application that I developed using the Android 1.1 SDK that I am trying to port to Android 1.5. In my application, I record a sound through the microphone and then do various things with it, including playing it back using a MediaPlayer object. My code works fine when I use the 1.1 target, but when I use a 1.5 target I get this error when setting up the player:
Command PLAYER_SET_DATA_SOURCE completed with an error or info PVMFErrNotSupported error (1, -4) Couldn't setup MediaPlayer java.io.IOException: Prepare failed.: status=0x1 at android.media.MediaPlayer.prepare(Native Method) at org.byu.chum.AudioUtils.AudioRecording.stopRecording (AudioRecording.java:92) at org.byu.chum.SoundRecorder.Recorder$StopListener.onClick (Recorder.java:198)...
It seems like Android isn't liking the format of my media, but I don't know why, since I just recorded that very format on the Android device. Here's the code that is throwing the error:
player = new MediaPlayer();
try { player.setDataSource(recordFile.toString());
player.prepare(); } catch (IOException e) { Log.e("playRecording", "Couldn't setup MediaPlayer", e); }
View 13 Replies
View Related
Apr 13, 2010
I am unable to use the following to code to play multiple sounds/beeps simultaneously. In my onclicklistener I have added
... public void onClick(View v) { mSoundManager.playSound(1);
mSoundManager.playSound(2); } ...
But this plays only one sound at a time, sound with index 1 followed by sound with index 2. How can I play atleast 2 sounds simultaneously using this code whenever there is an onClick() event?
public class SoundManager {
private SoundPool mSoundPool;
private HashMap<Integer, Integer> mSoundPoolMap;
private AudioManager mAudioManager;
private Context mContext;
public SoundManager() {
} public void initSounds(Context theContext) {
mContext = theContext; mSoundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 0);
mSoundPoolMap = new HashMap<Integer, Integer>();
mAudioManager = (AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE);
} public void addSound(int Index,int SoundID)
{ mSoundPoolMap.put(1, mSoundPool.load(mContext, SoundID, 1));
} public void playSound(int index) {
int streamVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
mSoundPool.play(mSoundPoolMap.get(index), streamVolume, streamVolume, 1, 0, 1f);
} public void playLoopedSound(int index) {
int streamVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
mSoundPool.play(mSoundPoolMap.get(index), streamVolume, streamVolume, 1, -1, 1f);
} }
View 1 Replies
View Related
Jun 14, 2010
Shown are a few lines of code. If I play a single sound, it runs fine. Adding a second sound causes it to crash.
private SoundManager mSoundManager;
/** Called when the activity is first created. */
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); setContentView(R.layout.sos);
mSoundManager = new SoundManager(); mSoundManager.initSounds(getBaseContext());
mSoundManager.addSound(1,R.raw.dit); mSoundManager.addSound(1,R.raw.dah);
Button SoundButton = (Button)findViewById(R.id.SoundButton);
SoundButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) { mSoundManager.playSound(1);
mSoundManager.playSound(2); } } ); }
View 1 Replies
View Related
May 19, 2010
I'm playing some MediaPlayer instances at the same time (4 or 5) but sometimes when I try to start a new media player it doesn't work and an error is shown on the log:
E/AudioFlinger( 1073): no more track names availlable E/AudioTrack( 1073): AudioFlinger could not create track, status: -12 E/AudioSink( 1073): Unable to create audio track E/VorbisPlayer( 1073): mAudioSink open failed
It also happens when there're only 3 or 2 MediaPlayer playing at the same time. What does it mean this error? How can I workaround with it? Actually checking the isPlaying() after the start() call does not seem very helpful as every call returns true. I've to say that every MediaPlayer is created once via MediaPlayer.create.
View 5 Replies
View Related
Jul 28, 2010
I have some pretty simple Soundboard applications on the Android Market that work flawless on an LG Ally, the Motorola Droid, and the Nexus One, but I recently received an e-mail from a user with the Motorola DroidX claiming that most of the sounds do not work. I've exchanged a few e-mails with him. He claims the Soundboard is the only application running, and he's double checked to make sure that the Media Volume wasn't set to minimum. I really don't have access to one either to play around with. The application isn't doing anything cosmic to play the sounds. Below is a code snippet. Any insights into what might be causing the hang up are greatly appreciated.
public void play(Sample sample) {
Log.v(TAG, "Playing: " + getString(sample.getButtonTextResId()) + " (" + sample.getSoundResId() + ")");
if (mPlayer != null) { mPlayer.stop(); mPlayer.release();
} MediaPlayer player = MediaPlayer.create(this, sample.getSoundResId());
mPlayer = player; if (player != null) { player.setVolume(1.0f, 1.0f);
player.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
@Override public void onCompletion(MediaPlayer mp) { mp.release();
mPlayer = null; } } ); player.start(); } }
View 1 Replies
View Related
Feb 5, 2009
I am using mp3 sound in my game (used wav format also) while playing sound I get problem as "obtainBuffer timeout (is the CPU pegged)" and then sound gets played after some time i.e it is not synchronized with the game play.
View 10 Replies
View Related
Sep 16, 2009
I've the following code I'm trying to run on emulator ( v 1.5 of OS), but it seems like I can't use the whole canvas! Code...
View 2 Replies
View Related
Jun 4, 2010
So I plugged some headphones in so I could try ringtones. It plays out the speaker and the headphones. Is that right? going to try some music next.
View 1 Replies
View Related
Oct 15, 2010
I just noticed a very unpleasant thing about the wildfire - while listening to music (or when playing any other sound), I can hear subtle hissing in the background. It is almost unnoticeable when I'm outdoors and there's noise outside, but it prevents me from listening more quiet music like jazz at home.
Can anything be done about it? Do you people also hear that (you have to be in complete silence and use decent headphones - the hissing is easy to notice as it disappears after 2 or 3 seconds after you pause music). I was so happy about my wildfire - I have 16gb sdcard so I thought it would make a great mp3 player.
View 2 Replies
View Related
Jan 20, 2009
I am trying to create small simple application on emulator. I want to create button and display with some click event. I am not able to use findViewById method with R.id.abc. It always gives error as R.id cannot be resolved.
View 2 Replies
View Related
Aug 25, 2010
I have set up Eclipse with the Android plug-in, and the Android SDK. But I can't get my simple Hello World application to run in the emulator.
I am going through this Hello World tutorial. I have Installed a Platform, Created an AVD, Created a New Android Project, and Constructed the UI, but when I hit Run (and select Android Application from the menu that pops up), the Emulator starts up. It takes a while on the "ANDROID_" screen, then shows the shimmering Android logo for a while. But then it goes to the "unlock" screen. When I slide the lock to the right, it opens the Android home screen. I try looking for my app in the applications lists, but it is nowhere to be found.
View 8 Replies
View Related
Jan 17, 2014
can i get the source code for the simple map display on android emulator?
View 1 Replies
View Related
Jul 8, 2010
I would really love to do this and was hoping there was a way. i dont even care that quality would be compromised. anybody?
View 6 Replies
View Related
Sep 6, 2010
YouTube - Droid X Snes Emulator Playing Through HDMI on a Samsung TV Using a Wii Remote in 3D and HD!
View 20 Replies
View Related
Apr 28, 2012
I have a Droid Bionic. I like it. But I was recently having some GMail syncing issues and during the troubleshooting for that I uninstalled the latest GMail update and reinstalled it. As a result, GMail is now doing audible notificatrion sounds for new email when before I only had notification in t he notification bar. I can't seem to get it turned off. I still want calendar events and texts to sound so I don't want to silence the phone but I want email and GMail to be silent (Notification icon only).
View 5 Replies
View Related
Aug 6, 2010
I created a sqlite database to store playlists for a media player I am developing because of extended feature (rather than using the Content Provider). It works perfectly on the 1.6 emulator but FCs on anything higher than 2.0... what has changed that I need to know about as far as opening databases in SDK 2.0+? Here is the logcat.
CODE:.............
Here is the dbhelper class
CODE:................
why can't stackoverflow just use tags like a normal syntax highlighter.
View 2 Replies
View Related
Apr 13, 2010
Finally strace gave me this:
CODE:................
And several other attempts to call "link" that also fail (sshfs does not support hard links).
Is it possible to change the emulator's behavior to create lock files somewhere in /tmp (using some hash of image path as lock file name)? I am OK to try this myself: which repositories from https://android.git.kernel.org/ are necessary to rebuild the emulator alone, and where in the sources is the code responsible for image locks?
View 4 Replies
View Related
Apr 20, 2009
I need to run several emulator instances to test my application. When i try to run instances using emulator -data <path> option, the emulator crashes.
I got a MS Visual Studio window informing that emulator throws a "unhandled win32 exception".
The exception message in the debugger (MS Visual Studio 2008) is: "Unhandled exception at 0x77c4706c in emulator.exe: 0xC0000005: Access violation reading location 0x03216848"
The emulator runs normally without "-data" option.
View 2 Replies
View Related
Nov 1, 2010
I am getting the following error when I try running my program in the emulator:
emulator: ERROR: the user data image is used by another emulator. aborting`
View 1 Replies
View Related
Apr 8, 2009
Is there a way to reload an Android application in the emulator without closing the emulator, saving any code changes, and running the emulator again? If I make even a simple change to the layout, it takes about 30 seconds by time I run it in Eclipse and Android "boots", and I can unlock the emulator to run the application. Is there any way to shorten this time when making changes, or is it something I just have to deal with?
View 3 Replies
View Related
Mar 16, 2010
I downloaded the most recent version of Android for linux (android-sdk_r05-linux_86.tgz). I was trying to use the the Android Ant task(s) for packaging, building, and deploying my code. I should mention that I'm running AMD64, but have the 32-bit libraries installed. The Android Ant tasks are all broken.
First, the start-emulator task never gets the emulator running. It does get past starting adb, but then just sits there.
Second, the SDK is missing the aapt binary in the tools directory. So, the example notepad sample application will not even package correctly.
I have all the dependencies configured for Android. I can run it from the command line just fine.I assume the Ant code is out of sync with the recent SDK updates. Can anyone shed some light on this problem? At this point, I'm considering writing my own Python scripts to interact with the Android SDK. Ugh.
View 1 Replies
View Related
Sep 24, 2010
In my dummy application i want to send MMS. But i don't know how to check it.I know that we can send SMS from one emulator to another but, is it possible for MMS? If yes then how it can be done.
View 3 Replies
View Related
Oct 13, 2010
Basically im trying to create a simple gui or a layout for android, and I'm really new to Android developing. I already found a way to create a list of stuff using ListActivity, and using the command Code...
View 2 Replies
View Related
Jun 3, 2010
I've tried astrid, and google, and syncing astrid with RTM (free version), and other to-do lists and calendars. I'm just looking for a simple agenda app, where I can click on a damn date and add a list of stuff I want to do without all the mess of prioritizing, adding times, colors, drops of blood, etc. I just want to click and type and have it there, laid out in a simple organized view. possibly a widget. does anyone know of anything like this? Or could someone create one? Not everyone needs an overcomplicated mess.
View 1 Replies
View Related
Jul 24, 2010
I need to save my bank account numbers, passwords and some credit card numbers. I do not need an app that is all that high tech and complicated. I would just like something that is protected via a password so that if my phone is lost/stolen the finder cannot access this information. I tried Keepass but I didn't really like it as I was unable to change the entry fields, ect. It would be nice to have the ability to have this information backed up somewhere.
View 10 Replies
View Related
Nov 17, 2010
I have been trying to reuse the tutorial on the Android developer website about developing a TabActivity App but, unfortunately, it never worked, even when I constructed it the exact same way as it is described...
Using the debugger it seemed the problem came from the main layout.
-> setContentView(R.layout.main); //After this line the app stops.
Here is my main.xml:
CODE:.............................
View 1 Replies
View Related
May 28, 2010
I haven't seen any docs on using the new ContactsContract API. Can someone please direct me to an example/explanation of using it?
View 1 Replies
View Related