Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Synchronize between Thread of recording and Main Thread

Synchronize between Thread of recording and Main Thread

All your problems with Audio, Video and Images.

Synchronize between Thread of recording and Main Thread

Postby luanbt » Tue Feb 22, 2011 10:38 am

While I'm developing VoiceRecorder using MediaRecorder, I saw issue as follow :

STEP:
+ using MediaRecorder to record.
+ using System.currentTimeMillis() to measure the time recording.
+ use timer (Handler.postDelayed) to update the time once 1 second.
+ recording a long time (I try to record more than 2 hours).
= 2 hours --> stop recording automatically and save file.

RESULT:
+ when timer = 2 hours, stop recording. But, when I get actual file, the DURATION is less than 2 hours (about 1:59:52)

I think that, it's non-synchronized between Recording Thread and Main Thread. I haven't solution at the moment, do any body have a solution to help me solve this isue?
thank you very much.
---------------------------------------

//source Recording:
mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setOutputFormat(outputfileformat);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mRecorder.setOutputFile(mSampleFile.getAbsolutePath());
mRecorder.setMaxDuration( MAX_DURATION ); //MAX_DURATION = 2hours

...

//source update timer:
if(nTime >= MAX_DURATION){
//stop recording and save file here
}else{
handle.postDelayed(handle, 1000);
}
luanbt
Freshman
Freshman
 
Posts: 7
Joined: Tue Feb 22, 2011 8:00 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 6 guests