Motorola :: Android AudioRecord Fails To Initialize

Nov 12, 2010

I've been having an issue with using AudioRecord for Android. I've read as much as I can find online about it, but I cannot seem to get a good initialization. I have tried the Android 2.2 emulator, 1.5 emulator and my phone, an HTC Incredible running Froyo. The emulators and my phone fail initialization. I've tried sampling rates of 8000, 11025, and 44100, formats of CHANNEL_IN_MONO/STEREO and CHANNEL_CONFIGURATION_MONO/STEREO, 8bit and 16bit encoding (8 bit makes the getMinBufferSize fail), and Audio Source of MIC and DEFAULT. All result in the variable test becoming 0 after running a get state(failed initialization). It seems from everything I've read that this should correctly initialize the object. I have played around with the multiplier on buflen, to have it range from 512 (the result of the function) to 102400 because I had heard that HTC devices require something above 8192. For testing my problem I made a new, small project that recreates my problem as simply as possible. I pull out the constants needed into local ints then run the constructor and access the getState method for checking if it worked. Code...

Motorola :: Android AudioRecord fails to initialize


Motorola :: Initialize A Class Instance?

Sep 27, 2010

I'm trying to initialize an instance of class console Droid with console Droid console = new console Droid();, but it throws a class, interface, or enum expected compile error. What's the right way to initialize the class?

View 4 Replies View Related

Android :: AudioRecord Doesn't Work For Motorola Milestone

May 4, 2010

I'm having this problem only on Motorola Milestone. Code:

CODE:................

The errorinformation I have (can't find more for the moment since I don't have a milestone myself for debugging):

CODE:..........................

Apparantly I'm not the only one with this problem. Some very similar threads I found (without solution):

http://groups.google.com/group/android-developers/browse_thread/thread/6dd24aeb484b2e40
[url]
[url]
[url]
[url]

View 4 Replies View Related

Android :: How To Initialize Media Recorder In Background?

Aug 5, 2009

I am building a camera app, where photos and videos are continuously being captured and saved to the SD card. The videos are short (few minutes), and their length are preset with setMaxDuration(). When Media Recorder.MEDIA_RECORDER_INFO_MAX_DURATION_REACHED is reached, the video is saved, and a new sequence is initialized with something like: The whole process works fine, while the main activity is in the foreground. But, when I go to another activity (e.g. settings), the video recording works in the background only until max duration is reached. The file is saved, but a new sequence can not be started because prepare() fails. setPreviewDisplay() needs to be there, but it doesn't like not having a proper surface to attach to. I tried to use a dummy Surface, a dummy SurfaceHolder, or reuse the Camera with mMediaRecorder.set Camera(), but nothing works. Is there a way to initialize Media Recorder in the background?

View 2 Replies View Related

Android :: Initialize Preferences From XML In Main Activity

May 20, 2010

My problem is that when I start application and user didn't open my PreferenceActivity so when I retrieve them don't get any default values defined in my preference.xml file. Code...

View 3 Replies View Related

Android :: OpenGL Textures Fails On Motorola Milestone

Jun 30, 2010

I have troubles with OpenGL textures on Motorola Milestone with 2.1 firmware. Each call to glGenTextures fails with error GL_INVALID_OPERATION and sets the id with random numbers. The exact same application works on G1 without any error.

View 1 Replies View Related

Android :: Need To Re-initialize / Kill A Core Process Silently?

Nov 24, 2009

What is the quickest way to restart or re-init the launcher a core process without the "you've killed the a core process unexpectedly" notification message?

View 2 Replies View Related

Android :: Editor Layout - Initialize Class Sun.awt.X11.XToolkit

Feb 21, 2010

I m developing an android app, i ve had a problem with the layout editor. I m using eclipse 3.5.1 for RCP/plugin developers, the android developers kit version 0.9.5 and jdk 1.6 in ubuntu 8.04 hardy heron. I ve been working good until one day i had to modificate my UI. when i tried to see my main.xml layout i found the following error: Null Pointer Exception then NoClassDefFoundError: Could not initialize class sun.awt.X11.XToolkit. I was looking for a solution but i didn't find so i reintalled all. Eclipse, ADT, SDK and Java. First it (layout) looked to work again but in two days it broke again. I m so frustrated cause i dont know what i do to get this error. First it works then don t .why?

View 3 Replies View Related

Android :: Initialize Sender ID For C2DM Without Using A Hard-coded Value?

Oct 18, 2010

I'm adding Android C2DM to a Android library project. I started with the com.google.android.c2dm package that is included with JumpNote and Chrome To Phone. In order to use this package, you have to subclass the C2DMBaseReceiver service which takes the Sender Id as an argument to it's constructor. In JumpNote, this argument is initialized using a hard-coded static variable in a config class. However, in an Android library project, which may be used by multiple concurrently running apps I don't think I can use a hard-coded static variable (that is, I believe it could lead to problems when/if multiple apps are trying to access/modify the static variable). I tried to think of a way to initialize the Sender Id without using a static variable and am stumped so far.The obvious solution would be to use the Manifest or a Resource string or a combination of the 2. For example, in strings.xml I might have a "ac2dmSender" string, which is accessed in a meta-data child of the C2DMReceiver service declaration in the manifest. However, it seems that you cannot get a reference to the PackageManager or ResourceManager from a static context, so there is no way for me to then retrieve the meta data in such a way as to pass it in to the constructor of C2DMBaseReceiver.

View 1 Replies View Related

Android :: Using AudioRecord API

May 15, 2009

I'm trying to figure out how to use the AudioRecord class.I created a callback with a logging message, but don't ever see it called.Do you see anything wrong with what I'm doing? Do you have an example of how to use the API?

View 6 Replies View Related

Android :: Can I Initialize An Array List From Data Specified In Xml Resource File?

Mar 9, 2009

Is is possible to specify data in xml resource file and initialize ArrayList from it? I am looking for a way to use the ArrayList with a SimpleAdapter to bind to a ListView. I am wondering if there is a way to specify my data in xml resource file and init ArrayList from it.

View 6 Replies View Related

Android :: Company Field Doesn't Initialize / Add Contacts Via Intent?

Sep 16, 2009

I am trying to add new contact using intent...

This code works but not adds several phones and company field doesn't initialize. What I do wrong?

View 2 Replies View Related

Android :: How To Use AudioRecord And AudioTrack?

Apr 30, 2009

I want to use AudioRecord and AudioTrack classes(in SDK 1.5) in my program. Where can I find how to use it. Is there any API demo program for this?. If not it is greatly appreciated if someone can post a sample code in this forum.

View 7 Replies View Related

Motorola Droid X :: 2.2 Fails To Install

Sep 22, 2010

Did a factory reset. Unrated did not remove Ny bloatware juat rooted to use wifi tether. Now the ota update keeps failing. What is going on?

View 45 Replies View Related

Android :: Synchronizing AudioTrack And AudioRecord

Jan 21, 2010

My application uses AudioTrack in streaming mode and AudioRecord simultaneously.My problem is that I start them at the same time, but I have no guarantee that they will actually start playback ecording in the same timestamp. The reason I need this kind of accuracy is because I use echo cancellation (subtracting audio played to speaker from the recording).My echo canceller doesn't require an exact delay, but the delay introduced between AudioTrack and AudioRecord moves in the range of 250ms (between different runs), and that's too much - each run is different because they start themselves asynchronously. The API doesn't provide me a way to make sure they start in the same time, so I thought about measuring this starting delay somehow and then using it in my calculation.Does anyone have an idea how to do that, utilizing their API or in any other way?

View 2 Replies View Related

Android :: How To Add Own Audio Codec To AudioRecord?

Mar 10, 2010

I currently have a Loop back program for testing Audio on Android devices.It uses AudioRecord and AudioTrack to record PCM audio from the Mic and play PCM audio out the earpiece. So as you can see in the creation of the AudioTrack and AudioRecord the Encoding is supplied via the AudioFormat but this only allows 16 bit or 8 bit PCM.I have my own G711 Codec implementation now and I want to be able to encode the audio from the Mic and decode it going into the EarPiece, So I have encode(short lin[], int offset, byte enc[], int frames) and decode(byte enc[], short lin[], int frames) methods but I'm unsure as to how to use them to encode and the decode the audio from the AudioRecord and AudioTrack.

View 2 Replies View Related

Android :: AudioRecord Is Not Working On Emulator

Nov 11, 2010

I used AudioRecord on emulator and phone. I found that AudioRecord is not working on phone: 1> the min-buffer-size on simulator is much smaller than phone 2> The audio data I read from phone is all zero.

View 2 Replies View Related

Android :: AudioRecord On Emulator With Frequency 8 KHz

Mar 25, 2010

I'm doing a voice recording using AudioRecord class and the main requirement that the frequency must be 16000 Hz. I'm using only emulator in development process for now and met the problem that I can't set frequency more than 8000, otherwise I get bufferSize -2, and can't create instance of AudioRecord with such buffer. Thank you to Szabolcs Vrbos, he told me that this problem is only with emulator and several Samsung phones, device can record with higher frequency.I need a word from Android engineers that I will be able to record voice with 16000 Hz frequency on for instance HTC Hero (Android 1.5)or similar device with os 1.5 or higher.

View 2 Replies View Related

Android :: Relation Between MediaRecorder And AudioRecord?

Apr 1, 2010

the location where the audioflinger, surfaceflinger and cameraservice talk to MediaRecorder's APIs? Is there any relation between MediaRecorder and AudioRecord?

View 6 Replies View Related

Android :: AudioRecord On Samsung Moment

Sep 25, 2010

We have been getting reports of audio recording not working on Samsung Moment phones on 2.1-update1.

int bufferSize = AudioRecord.getMinBufferSize(sampleRate, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT); this.audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC, sampleRate, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT, bufferSize);

generates these logs: I/AudioPolicyManager( 1889): getInput() inputSource 1, samplingRate 16000, format 1, channels 10, acoustics 0 W/AudioHardwareALSA( 1889): openInputStream : mInput already exists!! E/AudioRecord( 2618): Could not get audio input for record source 1 E/AudioRecord-JNI( 2618): Error creating AudioRecord instance: initialization check failed. E/AudioRecord-Java( 2618): [ android.media.AudioRecord ] Error code -20 when initializing native AudioRecord object. I can't find the "mInput already exists". anywhere in the source base, could this perhaps be an error message included by the OEM?

View 4 Replies View Related

General :: Camera Is Unable To Initialize?

Aug 18, 2011

For some reason the camera and Camcorder no longer work. I have a Droid x2 and recently updated the software.

View 3 Replies View Related

Motorola Droid :: MMS Picture Messaging Fails

Nov 16, 2009

I'm having issues sending picture messages using the messaging app. I get an error saying that I typed in an invalid address. I think that this is because its not resizing the images that I try to send.... When i use Handcent all works like it is supposed to but not when I use the default messaging application.

View 5 Replies View Related

Motorola Droid X :: Gmail Fails To Sync After 2.2 / Fix It?

Sep 22, 2010

Ok. I followed all the correct guides and updated my phone to the 2.2hack. After initial startup and re install of boot strap my gmail will not sync. It has been stuck at "your email will appear shortly" for an hour I have a back up recovery of 2.1 but i really want to run 2.2 without getting the OTA.

View 4 Replies View Related

Android :: How Can I Get Amplitude Volume / When Recording With AudioRecord?

Apr 6, 2010

How can I get the amplitude/volume when recording with AudioRecord?

View 2 Replies View Related

Android :: AudioRecord Producing No Sound Data

Dec 6, 2009

Here is my AudioRecorder class, using audio record, why is it not producing any sound data?

import java.io.FileOutputStream; import java.io.IOException; import android.content.Context; import android.media.AudioFormat; import android.media.AudioRecord; import android.media.MediaRecorder; public class AudioRecorder implements Runnable {public boolean isRecording = false; byte[] tempBuffer = new byte[AudioRecord.getMinBufferSize(44100, AudioFormat.CHANNEL_CONFIGURATION_STEREO,......

View 4 Replies View Related

Android :: AudioRecord Class To Analize Raw Pcm Bytes As It Comes In The Mic

May 27, 2010

I am using the AudioRecord class to analize raw pcm bytes as it comes in the mic.

So thats working nicely. Now i need convert the pcm bytes into decibel.

I have a formula that takes sound presure in Pa into db. db = 20 * log10(Pa/ref Pa)

So the question is the bytes i am getting from audiorecorder from the buffer what is it is it amplitude pascal sound pressure or what.

I tried to putting the value into te formula but it comes back with very hight db so i do not think its right

View 4 Replies View Related

Android :: Improper Audio Format While Using AudioRecord API / What To Do?

Oct 12, 2010

I am doing recording in following way and storing byte array in a binary file. But the binary file I am getting is not in any format. what can be the problem? code...

View 3 Replies View Related

Android :: AudioRecord Class - Callback Is Never Called

Feb 15, 2010

My Android Java Application needs to record audio data into the RAM and process it. This is why I use the class "AudioRecord" and not the "MediaRecorder" (records only to file).

Till now, I used a busy loop polling with "read()" for the audio data. this has been working so far, but it peggs the CPU too much. Between two polls, I put the thread to sleep to avoid 100% CPU usage. However, this is not really a clean solution, since the time of the sleep is not guaranteed and you must subtract a security time in order not to loose audio snippets. This is not CPU optimal. I need as many free CPU cycles as possible for a parallel running thread.

Now I implemented the recording using the "OnRecordPositionUpdateListener". This looks very promising and the right way to do it according the SDK Docs. Everything seems to work (opening the audio device, read()ing the data etc.) but the Listner is never called.

I am working with a real Device, not under the Emulator. The Recording using a Busy Loop basically works (however not satifiying). Only the Callback Listener is never called.

Here is a snippet from my Sourcecode:
CODE:.........................

View 2 Replies View Related

Android :: NexusOne AudioRecord Randomly Goes To Standby

May 9, 2010

On the nexus one, my app goes into Audio Record Stanby randomly after 0-40 seconds. I'm using the AudioRecord class, and while the standby is reported in the terminal, the AudioRecord instance reports the same states of RECORDSTATE_RECORDING and STATE_INITIALIZED throughout the entire sequence.

The bottom line is that when this anomaly occurs, audio is not captured. and this is what im working to prevent was only able to reproduce on nexus one android2.1 not g1 android1.6

I have looked extensively through the Android C/C++ libraries such as at this file: http://android.git.kernel.org/?p=platform/hardware/msm7k.git;a=blob_p... and [url]

Most interesting to me, is this line in AudioFlinger: [url]

Specifically the bool AudioFlinger::RecordThread::threadLoop()

As you can see, minput->standby() occurs in 4 different places in the code.

View 3 Replies View Related

Android :: AudioRecord - OnPeriodicNotification And OnMarkerReached Are Not Called

May 13, 2010

I've seen posts regarding problems with the AudioRecord OnRecordPositionUpdateListener, but I haven't seen any real answers.

I'm using AudioRecord to record from the mic, and I want to get the input from the mic periodically so I can check sound levels and update a meter.

I set up the listener like this:

CODE:...........

What happens is that onMarkerReached gets called once, after the recorder is released, so that's not very useful.

Do I need to change the marker position and notification period? Is the listener working? Is there another way to accomplish periodically getting the mic input?

View 4 Replies View Related







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