Forgive me for I have sinned.

by [EMAIL PROTECTED] » Tue, 13 May 2008 23:31:34 GMT


Sponsored Links
 There is something somewhere about not making an oath.

Well, as I cobbled demo code together for the ADC submission (one
trial strategy was to use the demo API look and feel by deleting all
the elements not needed), experiencing 19% errors causing reboot on
the evening of the 14th, I made an oath: "I will not touch this until
I can load a clean new SDK."  -predicting that a new one would be out
in a week or so. Time passed. The future was not as I predicted. The
lawn is mowed. The dog is in great shape again... not at all snippy...

Please, please, I have learned my lesson. Oaths imply one can predict
the future. Clearly not true for me...

New SDK please.

Ed
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. AudioRecord: onPeriodicNotification and onMarkerReached are not called

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:

        private OnRecordPositionUpdateListener mRecordListener = new
AudioRecord.OnRecordPositionUpdateListener()
        {
                public void onPeriodicNotification(AudioRecord recorder) {
                        if 
(recorder.getRecordingState()!=aRecorder.RECORDSTATE_STOPPED)
                        {
                                mAudioBuffer = new short[8000];
                                mSamplesRead = recorder.read(mAudioBuffer, 0, 
8000);
                                if (mSamplesRead > 0)
                                {
                                        // do something
                                }
                        }
                }

                public void onMarkerReached(AudioRecord recorder)
                {
                        if 
(recorder.getRecordingState()!=aRecorder.RECORDSTATE_STOPPED)
                        {
                                mAudioBuffer = new short[8000];
                                mSamplesRead = recorder.read(mAudioBuffer, 0, 
8000);
                        }
                }
        };

I instantiate the AudioRecord object like this:

                        // audioSource = MediaRecorder.AudioSource.MIC
                        // sampleRate = 16000
                       // channelConfig = AudioFormat.CHANNEL_IN_MONO
                       // audioFormat = AudioFormat.ENCODING_PCM_16BIT
                       // bufferSize = 409600

                        aRecorder = new AudioRecord(audioSource, sampleRate, 
channelConfig,
audioFormat, bufferSize);
                        if (aRecorder.getState() != 
AudioRecord.STATE_INITIALIZED)
                                throw new Exception("AudioRecord initialization 
failed");
                        
aRecorder.setRecordPositionUpdateListener(mRecordListener);
                        aRecorder.setPositionNotificationPeriod(400);
                        aRecorder.setNotificationMarkerPosition(400);

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?

-- 

2. AudioRecord creates a stereo file instead of a mono file.

Yes its a bug, sounds like the WAV header is wrong. You'll have to
hack at that source to fix it..





> 

3. Urgent Help: AudioTrack class ...Streaming Mode

4. Display progress of xml parsing?

5. Listener on Spinner

6. Capturing all the Browser Events

7. HTC Incredible not seeing market apps with GL 2.0 min set on manifest?