Android :: Playing Recorded Sounds In Application (Target 1.5)

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); }

Android :: Playing recorded Sounds in Application (Target 1.5)


Android :: Playing Multiple Sounds At Same Time In Application

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

Android :: Playing Multiple Sounds - Application Crashes

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

Android :: Playing Sounds In Game Application Using Media Player

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

Android :: Playing Recorded Message On Outgoing Call?

Nov 18, 2010

Is it possible to play a recorded message when making a phone call. I mean to call a contact and when the call is answered to play immediately a recorded message.

View 3 Replies View Related

HTC Desire :: Playing Recorded Video On Laptop

Aug 26, 2010

I cant play the videos i have recorded on my laptop as it doesnt recognise the 3gp format. How have you been getting around this as there are some i want to keep for memories but it is useless if i cant play them back on another device.

View 1 Replies View Related

Sony Ericsson Xperia X10 Mini/Pro :: Playing Recorded Video / First 5 Seconds Display Black

Oct 7, 2010

When I plays video recorded on my X10mini, about 5 second at the beginning it displays black. But I can hear the sound.

View 3 Replies View Related

Android :: Playing Sounds From Assets Folder

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

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 View Related

Android :: Playing Multiple Sounds - Error Shown On Log

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

Android :: Media Player Not Playing Sounds On Droid X

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

Android :: Project - Build Target Show No Target Available

Feb 23, 2010

I installed newst Android, JDK, Jer and eclipse. Than I tryed to build android project. But "build target" show "no target available". I looked at internet, they said I should run "Android SDK and AVD manager", I runed it but get follow message: Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml, reason: No route to host: connect

I read this group's conversation that suggest to use http not https, I tried it but still can not run Available Packages.

View 2 Replies View Related

HTC EVO 4G :: Playing Sounds With Headphones Plugged In?

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

Android :: Recorded Audio Not Found In Music Application

May 13, 2009

Now when I recording a file using sound recorder. But I cannot find it in the application of Music. When I reboot, I can find it in the Music.

View 2 Replies View Related

Android :: Target Running Application With KeyEvent?

Nov 12, 2010

my goal is to target with a keyevent a specific application running either in foreground or background from a background service. I tried many solutions, but have not yet managed to do it. The few solutions tried (all from a background running service): With a broadcast, I tried to target the first application (for example the phone app) that would manage the key event

KeyEvent lKey1Up = new KeyEvent(KeyEvent.ACTION_UP,KeyEvent.KEYCODE_ENDCALL);
KeyEvent lKey1Dwn = new KeyEvent(KeyEvent.ACTION_DOWN,KeyEvent.KEYCODE_ENDCALL);
Intent lKey1UpIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
Intent lKey1DwnIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
lKey1UpIntent.putExtra(Intent.EXTRA_KEY_EVENT, lKey1Up);
lKey1DwnIntent.putExtra(Intent.EXTRA_KEY_EVENT, lKey1Dwn );
sendOrderedBroadcast(lKey1UpIntent, null);
sendOrderedBroadcast(lKey1DwnIntent, null);

=> Nothing happens with my foreground phone app when the broadcast is performed while I am in a phone call state (OFFHOOK). Indeed, I was nearly sure this would not work since I have no way to specificely target the phone app.............

View 1 Replies View Related

HTC Wildfire :: Hissing When Playing Music And Other Sounds

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

Android :: Differences In Building For Target 2 And Target 3 In 1.5 Sdk

Oct 7, 2009

What are the differences between building for target 2 (no gmaps add on) and target 3 (with gmaps addon).

Could any one has the ant scripts to bulids for these targets.

I see 1.5 SDK does these though custom ant tasks rather than 1.1 ant scripts (this was more clear and apperant on how it does the build)

View 4 Replies View Related

Missing Target Class To Test In Test Application?

Nov 10, 2011

I have a project (that compiles and runs in the emulator.) I have a test project that tests part of this project. This test project also compiles with no problems, but when I try to run (test) it in the emulator, I get a NoClassDefFoundError exception on one of the classes my test class tests (I hope that made sense!) when it starts to run in the emulator. This is coming out of the adb log. I looked in the bin directory (of the test project) for the missing class, but could not find it... Should it be there? I found no reference (apk, etc) of the project I am trying to test either in the test projects bin directory. How does the test project get the classes it needs to test against (in the classpath, I assume.) How do the tested classes get moved to the emulator? I did try running the app before testing, so I know it is installed and runs correctly. BTW, I am using netbeans with the nbandroid plugin.

View 1 Replies View Related

Android :: Music Playing Application?

Oct 1, 2010

I'm currently using double twist, but it doesn't seem to allow you to "play all" by an artist. I need a music player that will allow me to do that. I use the phone as a "best of" since all of my music can not fit on the phone.

View 1 Replies View Related

Android :: Any Application To Speed Up Playing Podcast?

May 24, 2010

Got used to listening to my podcasts on my iPod touch in 2X speed. Would like to use my Incredible the same way. Anybody know of a way to speed up the playback? I looked in settings, and didn't find anything, so suspect will need an app or something. On second note, is there a way to access the Market from a computer? Searching via the phone is pretty hard to do.

View 3 Replies View Related

Android :: Detect Another Application Started Playing Audio

Aug 26, 2010

My music application constantly plays music in the background, however I'd like to be able to detect when another application starts playing audio (such as the YouTube app) so I can pause/mute/stop the audio in my application. This will allow a user to continue browsing the web whilst listening to music, but then if they wish to watch a video at any point, they can do so without audio conflict.

One solution might be to listen for a broadcast which states when an application begins using the AudioManager. Does such an Intent Action exist? Edit: As in the answer provided below, there appears to be a method of detecting the loss of audio focus in 2.2 with AudioManager.OnAudioFocusChangeListener.

View 1 Replies View Related

Media :: Application To Turn Off Notification Sounds

Mar 6, 2010

Is there a way to turn off the notification sounds at a certain time of day? I hate the sound of getting e-mail at 2 in the AM and waking me up. I have a Telus Milestone which runs v2.0.1

View 7 Replies View Related

Motorola Droid X :: Application To Split SMS / Gmail Notification Sounds?

Nov 26, 2010

So, I would like to assign separate ringtones for my gmail and sms alerts. Apparently, the Android system groups these together; I can assign a different tone for regular email, but not gmail, as the Android system groups them under "notifications." Is there an app out there for this?

View 9 Replies View Related

HTC Hero :: Find Song Playing Little With Application?

Nov 13, 2009

Can you remind me please what is the name of the App that I believe I read about that you can find out a song just by playing a little with the App running? It sounds like a Cool little thing, well to my Childish mind it does.

View 10 Replies View Related

Samsung Moment :: Any Application For Playing MP4 Files?

Apr 8, 2010

Is there an app that plays mp4 files?

View 7 Replies View Related

General :: Getting Calendar Event Sounds Without GMail Sounds

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

Android :: Blank Video Being Recorded

Aug 19, 2009

I am trying to develeop a video capture application on the HTC Ion device using the MediaRecorder class. The application seems to run and record MP4 output file, but it is blank when I view it with QuickTime! I am wondering if I am setting up the MediaRecorder correctly. Also, expected to see a live preview because a Surface to display the preview was set . But nothing shows up. Any one have suggestions as to what could be doing wrong?

View 2 Replies View Related

Android :: Microphone Cannot Be Recorded On Emulator

Aug 10, 2010

A small program that I wrote cannot record the microphone. One api call, getminbuffersize keeps returning -2 which is not correct. The program works on a real android one. I use 11025Hz, 16bit pcm,mono recording.

View 4 Replies View Related

Android :: There Is NO AVD Target?

Oct 30, 2009

Trying to set up my eclipse envirnment to actually be able to try some things out on android...

I've installed the sdk, put it in my path variable, installed the ADT, downloaded the "developer tools" from the eclpise menu..

But... Then I go to the command line, navigate to the tools folder of my sdk, and run "android create avd --target 2 --name mine"

and I get this "error":

Error: Target id is not valid. Use 'android.bat list targets' to get the target ids.

So, I of course happily run the 'android.bat list targets' and get the following message!

"Available Android Targets:"

That's it. There are no targets.... I open the AVD window in eclipse, there are no targets... I click "New" in that window, and a target is required, but the drop down is disabled because there are NO AVD TARGETS.

View 8 Replies View Related

Android :: SDK Target Must Be Specified?

Jan 21, 2010

I'm really new at this. I'm following the book "Android" by O'Reilly press a little outdated, I'm using Pulsar for Mobile Java Developers. Build id: 20090920-1017 I go to File, New Project, Android, Android Project. I enter "Hello World" for Project Name. Then I get "An SDK Target must be specified." There is a check box but it says "no target specified". How do I get this resolved and how do I get to the command line?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved