Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry® Torch™

Reply
New Contributor
wireless_project
Posts: 4
Registered: ‎01-24-2011
My Device: Torch 9800

Problem with recording and playing volume

Hi, All

 

I am having a really wierd problem when recording and playing at the same time. I have two threads:

a recording thread that record signal from MIC in the format of WAV.

a playing thread that play sound to both left and right sound channels.

 

If I just run the playing thread with maximum sound (volume=100), I can hear the sound playing loud. Now if I kick off the recording thread, the playing sound suddenly drop to half (or even less) of the original volume.

 

I did some debugging and found that the player of the recording thread seem to be fine, but the RecordControl of the recording thread seem to be the problem. Once it started, the sound volume dropped.

 

How can the recording functionality affect the playing sound:smileymad:? It only read data from MIC, and should not interfere the output from sound channels. 

 

Any clues/suggestion will be greatly appreciated Thanks

Please use plain text.
New Contributor
wireless_project
Posts: 4
Registered: ‎01-24-2011
My Device: Torch 9800

Re: Problem with recording and playing volume

Anyone? my recording thread is something like this

 

            _player = javax.microedition.media.Manager.createPlayer("capture://audio?encoding=pcm&rate=8000&bits=16&channels=1");  
                _player.addPlayerListener(this);

                _player.realize();
                _player.prefetch();                
                
             VolumeControl _volume = (VolumeControl)_player.getControl("VolumeControl");                            
             _volume.setLevel(100);     
                             
       recordingByteOut = new ByteArrayOutputStream ();                
                _recordControl = (RecordControl) _player.getControl( "RecordControl" );                                      
                _recordControl.setRecordStream(recordingByteOut);              
                _recordControl.startRecord();       
                                                
                _player.start();

 

<==============End

 

My player thread is something like this

 

con = (FileConnection) Connector.open(strWavFile, Connector.READ);    
fis = con.openInputStream();
   
  
mediaPlayer = javax.microedition.media.Manager.createPlayer(fis, "audio/X-wav");
mediaPlayer.realize();
mediaPlayer.setLoopCount(100);
mediaPlayer.prefetch();
       
VolumeControl volume = (VolumeControl)mediaPlayer.getControl("VolumeControl");                            
volume.setLevel(100);  
         
mediaPlayer.start();

 

<=====End

 

After recording thread kicked off, the player volume , as I can hear, drop sharply. Plus only one ear piece has sound. the other one just turn silent

 

 

Really lost on this kind of undocumented  behavior. Any help will be great

Please use plain text.