×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    41

    Need Help: producing with continuous Noise

    Hi! I'm playing an audio file. I'm having problem because the file play continuously with a Noise even if all the data is already played (i see it during debug. the file is already decoded and played but it still producing noise even i click the stop button)

    How can I stop that noise it producing?

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,144

    Re: Need Help: producing with continuous Noise

    Firstly, you should propably ask the question under the technology you are using for development, and secondly, you propably could show a piece of code you are having problems with..

  3. #3
    Registered User
    Join Date
    Dec 2008
    Posts
    41

    Re: Need Help: producing with continuous Noise

    i'm using carbide c++ and sdk s60 3rd edition feature pack 2...

    here is the code:

    void CRFsEngine::MaoscBufferCopied(TInt aError, const TDesC8& /*aBuffer*/)
    {
    TBool finish = EFalse;

    if (aError==KErrNone)
    {
    TBool isEnd = EFalse;

    for(TInt i = 0; ETrue; i++)
    {
    iAlgo = iReader->Read(8);

    if(104 == iAlgo)
    {
    // decode
    }
    else if(100 == iAlgo)
    {
    // decode
    }
    else if(97 == iAlgo)
    {
    // decode
    }
    else
    {
    finish = ETrue;
    break;
    }

    if(iOutputDecompression->Count() >= 80)
    {
    do
    {
    Transform();

    }while(iOutputDecompression->Count() >= 80);
    }

    if(isEnd)
    {
    break;
    }
    }

    if(finish)
    {
    return;
    }

    if(iBufStatus && !finish)
    {
    iStream->WriteL(rBufMdct1);
    }
    else
    {
    iStream->WriteL(rBufMdct1);
    }
    }
    }

    Can somebody help me?

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,144

    Re: Need Help: producing with continuous Noise

    Hard to see from that piece of code, but have you checked if you still continue writing something into the stream. The "noise" should propably not just happen, it is likely to be something wrong with your logic..

  5. #5
    Registered User
    Join Date
    Dec 2008
    Posts
    41

    Re: Need Help: producing with continuous Noise

    how can i check if it still continue writing something into the stream?

  6. #6
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,144

    Re: Need Help: producing with continuous Noise

    You could try debugging it, put some breakpoints and see how it goes, or write to a begig file..

  7. #7
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: Need Help: producing with continuous Noise

    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  8. #8
    Registered User
    Join Date
    Dec 2008
    Posts
    41

    Re: Need Help: producing with continuous Noise

    i tried to do what is on this link: 'http://wiki.forum.nokia.com/index.ph...filled_buffers' but it still doesn't work...

    it still producing noise...

    when i try to debug it and put some breakpoint in the code...

    it still producing noise...

    i really need to fix this one....

  9. #9
    Registered User
    Join Date
    Dec 2008
    Posts
    41

    Re: Need Help: producing with continuous Noise

    i tried to do what is on this link: 'http://wiki.forum.nokia.com/index.ph...filled_buffers' but it still doesn't work...

    it still producing noise...

    when i try to debug it and put some breakpoint in the code...

    it still producing noise...

    i really need to fix this one....

    Here is the code i'm using:

    Code:
    void CRFsEngine::MaoscBufferCopied(TInt aError, const TDesC8& /*aBuffer*/)
    {
    	TBool finish = EFalse;
    	TInt error;
    		
    	if (aError==KErrNone)
    	{   
    		TBool isEnd = EFalse;
    			
    	        for(TInt i = 0; ETrue; i++)
    		{
    			iAlgo = iReader->Read(8);
    				
    			if(104 == iAlgo)
    			{
    				TUint numDec = iReader->Read(32);
    				iHuffman->createStats();
    				iHuffman->Decode(numDec);
    			}
    			else if(100 == iAlgo)
    			{
    				iDifferential->DecodeDifferential();
    			}
    			else if(97 == iAlgo)
    			{
    				iArithmetic->InitializedValues();
    			}
    			else if(110 == iAlgo)
    			{
    				iNoCompression->DecompressNoCompression();
    			}
    			else 
    			{
    				finish = ETrue;
    				break;
    			}
    				
    			if(iOutputDecompression->Count() >= 80)
    			{
    				do
    				{	
    					Transform();
    					
    					iOutputDecompression->Delete(0, 40);
    					iOutputDecompression->Compress();
    							
    					if(iCtrRBuf == 8000)
    					{
    						isEnd = ETrue;
    						iCtrRBuf = 0;
    							
    						if(iBufStatus)
    						{
    							iBufStatus = EFalse;
    						}
    						else
    						{
    							iBufStatus = ETrue;
    						}
    					}
    				}while(iOutputDecompression->Count() >= 80);
    			}
    				
    			if(isEnd)
    			{
    				break;
    			}
    		}
    		    
    		if(!finish)
    		{
    		    	if(iBufStatus)
    		   	{
    		    		TRAPD(error, iStream->WriteL(rBufMdct1));  
    		    	}
    		    	else
    		    	{
    		    		TRAPD(error, iStream->WriteL(rBufMdct2));  
    		    	}
    		    }
    		}
    		
    		if(finish)
                    {
                    return;
                    }
    	}
    }
    
    void CRFsEngine::PlayL()
    {
        	rBufMdct1.Close();
       	rBufMdct2.Close();
            
       	LoadFileL();
        
    	iStream->SetVolume(iVolStep * KInitialVolume); 
    				
    	iOutputDecompression->Reset();
    	    
    	iReader->SetTotalSizeExist(EFalse);
    	    
    	TBool isEnd = EFalse;
    	    
        	for(TInt i = 0; ETrue; i++)
    	{
    		iAlgo = iReader->Read(8);
    			
    		if(104 == iAlgo)
    		{
    			TUint numDec = iReader->Read(32);
    			iHuffman->createStats();
    			iHuffman->Decode(numDec);
    		}
    		else if(100 == iAlgo)
    		{
    			iDifferential->DecodeDifferential();
    		}
    		else if(97 == iAlgo)
    		{
    			iArithmetic->InitializedValues();
    		}
    		else if(110 == iAlgo)
    		{
    			iNoCompression->DecompressNoCompression();
    		}
    		else 
    		{
    			break;
    		}
    				
    		if(iOutputDecompression->Count() >= 80)
    		{
    			do
    			{	
    				Transform();
    				iOutputDecompression->Delete(0, 40);
    				iOutputDecompression->Compress();
    										
    				if(iCtrRBuf == 8000)
    				{
    					isEnd = ETrue;
    					iCtrRBuf = 0;
    					iBufStatus = ETrue;
    			    }
    			}while(iOutputDecompression->Count() >= 80);
    		}
    		
    		if(isEnd)
    		{
    			break;
    		}
    	}
        	
    	if(iStatus == EEngineReady)
    	{
    	   	iStatus = EEnginePlaying;
    	   	iStream->WriteL(rBufMdct1);        
    	}
    }
    
    void CRFsEngine::Transform()
    {
    	TInt iSize = 80;
    	TReal64 temp = 0.0;
    	TReal64 value = 0.0;
    	TUint32 final = 0;
    	TInt error;
    			
    	for(TUint i = 0; i < iSize; i++, temp = 0.0)
    	{
    		for(TUint j = 0; j < (iSize/2); j++)
    		{
    			final = iOutputDecompression->At(j);
    			value = (((2*PI)/iSize) * (i + d) * (j + .5));
    			error = Math::Cos(value, value);
    			User::LeaveIfError(error);
    			temp += iOutputDecompression->At(j) * value;
    		}
    			
    		temp = (temp * 4.0) / (TReal64) (iSize);
    		final = temp;
    		
    		// Here is the part where i replace the value in the buffer.
    		if(iBufStatus)
    		{
    			rBufMdct2[iCtrRBuf] = final;
    		}
    		else
    		{
    			rBufMdct1[iCtrRBuf] = final;
    		}
    				
    		iCtrRBuf++;
    	}
    }

Similar Threads

  1. How to listen noise arround the phone?
    By aamitgupta in forum Symbian
    Replies: 29
    Last Post: 2009-01-08, 14:42
  2. Noise while playing G.711 Audio
    By gpalvia in forum Symbian Media (Closed)
    Replies: 5
    Last Post: 2008-10-30, 16:35
  3. Providing continuous network stream
    By directx in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2008-04-07, 18:41
  4. Static noise from loudspeaker
    By Leviathan2040 in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2006-10-04, 08:12
  5. Continuous HTTP response handling.
    By khurshed79 in forum Symbian
    Replies: 1
    Last Post: 2005-10-03, 05:40

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •