×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    442

    How to use RSocket in Application?

    Hi

    I am making Audio Streaming application and I want to apply RSocket and get audio data into buffer.

    But i don't know how to use RSocket with this. please help me that hoe to do that?

    Regards,
    SymbianTH

  2. #2
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: How to use RSocket in Application?

    Hi,

    Check the link, might be helpful to you...
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  3. #3
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    442

    Re: How to use RSocket in Application?

    Hi

    I tried but Full Duplex application do not work. and actually i want to play audio from streaming server(using URL) i am able to play local file.

    so i want to use RSocket for store streaming data into buffer and after send data for play, but i don't know how i can use RSocket with Audio Streaming.

    SymbianTH

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,694

    Re: How to use RSocket in Application?

    "Audio Streaming" is a complex thing.
    Check if CMdaAudioPlayerUtility::OpenUrlL happens to do what you need.
    Otherwise you can go for RTP/RTC API-s from the plug-in pack: http://wiki.forum.nokia.com/index.php/SDK_API_Plug-in

  5. #5
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    442

    Re: How to use RSocket in Application?

    Hi

    Thanks for replay.

    I am doing but get -5 error, so i tried to read data using RSocket but do not know that how i can read data from following URL.

    iAuPlayUtil->OpenUrlL(_L("rtsp://rmlive.bbc.co.uk/bbc-rbs/rmlive/ev7/live24/radio1/live/r1_dsat_g2.ra"));

    I get it following snippets but how i can use with above code.
    Code:
    
    User::LeaveIfError(iSocketServer.Connect());
            //CleanupClosePushL(iSocketServer);
            User::LeaveIfError(iListener.Open(iSocketServer,KAfInet,KSockStream, KProtocolInetTcp));
                    
            User::LeaveIfError(iListener.SetLocalPort(80));
            //TInetAddr iAddress(KInetAddrAny,2345);
            //User::LeaveIfError(iListener.Bind(iAddress));
                    
            User::LeaveIfError(iListener.Listen(1));
            //TRequestStatus status;
            TBuf8<256> buffer;
            iSocket.Open(iSocketServer);
            iListener.Accept(iSocket, iStatus); 
            
            User::WaitForRequest(iStatus);
            
            TPtr8 gDataPtr(NULL,0);
            TUint32 msglen;
            TUint8 *buf=new TUint8[msglen];
            gDataPtr.Set(buf,0,msglen);
            iSocket.Read(gDataPtr,iStatus);
            
            User::WaitForRequest(iStatus);
    Regards,
    SymbianTH

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,694

    Re: How to use RSocket in Application?

    Quote Originally Posted by SymbianTH View Post
    I am doing but get -5 error, so i tried to read data using RSocket but do not know that how i can read data from following URL.

    iAuPlayUtil->OpenUrlL(_L("rtsp://rmlive.bbc.co.uk/bbc-rbs/rmlive/ev7/live24/radio1/live/r1_dsat_g2.ra"));
    Oops, you are right. That is a known issue. However you will find a possible workaround if you search for OpenUrlL in the Wiki.

  7. #7
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    442

    Re: How to use RSocket in Application?

    Hi

    I am trying to solve this -5 problem last many days but nobody give me any idea or solution.

    I find using google search that using RSocket we able to play audio from server. but how that i don't know.

    please help me. you are a nokia champion, if you have done this or have any solution please help me.

    i have already tried with AudioPlayerUtility, OutputStream now trying with RSocket.

    SymbianTH

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,694

    Re: How to use RSocket in Application?

    You can still consider searching for OpenUrlL in the Wiki...

  9. #9
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    442

    Re: How to use RSocket in Application?

    Quote Originally Posted by wizard_hu_ View Post
    You can still consider searching for OpenUrlL in the Wiki...

    Hi

    I searched but result is:

    In following link says that : CMdaAudioPlayerUtility::OpenUrlL() cannot be used for opening audio files or streams for playback.

    http://wiki.forum.nokia.com/index.ph...ot_implemented

    and this link show the code implementation: that i implemented in my application but void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds &aDuration) return aError = -5.

    http://wiki.forum.nokia.com/index.ph..._Playback_APIs.

    Regards,
    SymbianTH

  10. #10
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,694

    Re: How to use RSocket in Application?

    Quote Originally Posted by SymbianTH View Post
    In following link says that : CMdaAudioPlayerUtility::OpenUrlL() cannot be used for opening audio files or streams for playback.

    http://wiki.forum.nokia.com/index.ph...ot_implemented
    It is Ok, I meant this article. However it also suggests a solution, have you checked if it is suitable for your needs?

  11. #11
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    442

    Re: How to use RSocket in Application?

    Yes give error -5 (-5 = KErrNotSupported)

    I want to play audio file in following way
    iAuPlayUtil->OpenUrlL(_L("rtsp://rmlive.bbc.co.uk/bbc-rbs/rmlive/ev7/live24/radio1/live/r1_dsat_g2.ra"));

    now what i do? please help me.

    SymbianTH

  12. #12
    Super Contributor
    Join Date
    Jul 2007
    Posts
    596

    Re: How to use RSocket in Application?

    Quote Originally Posted by SymbianTH View Post
    Yes give error -5 (-5 = KErrNotSupported)

    I want to play audio file in following way
    iAuPlayUtil->OpenUrlL(_L("rtsp://rmlive.bbc.co.uk/bbc-rbs/rmlive/ev7/live24/radio1/live/r1_dsat_g2.ra"));

    now what i do? please help me.

    SymbianTH
    Is this error code u r getting on emulator or device . please check it on target device.
    Also try to open this url through local player of the device.

  13. #13
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    442

    Re: How to use RSocket in Application?

    Quote Originally Posted by kishore84 View Post
    Is this error code u r getting on emulator or device . please check it on target device.
    Also try to open this url through local player of the device.
    Hi

    Currently i am testing on Emulator, and this URL i tested on Emulator->File->OpenURL and it's Played Properly but do not work in programming.

    SymbianTH

  14. #14
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,694

    Re: How to use RSocket in Application?

    Just to make sure: iAuPlayUtil is CVideoPlayerUtility, is not it?

  15. #15
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    442

    Re: How to use RSocket in Application?

    My Code is:

    AudioPlayerAdaptor.cpp
    -----------------------
    Code:
    #include <eikenv.h>
    #include "AudioPlayerAdaptor.h"
    #include "FileLogger.h"
    #include <in_sock.h>
    #include <e32std.h>
    
    #ifdef __WINSCW__
    const TInt KMaxSound(65535);
    #else
    const TInt KMaxSound(100);
    #endif
    
    const TInt KOneSecond = 1000 * 1000; // 1 second in microseconds
    const TInt KVolumeDenominator = 2;
    
    CAudioPlayerAdaptor* CAudioPlayerAdaptor::NewLC(CAudioStreamAppUi* aAppUi)
      {
      CAudioPlayerAdaptor* self = new (ELeave) CAudioPlayerAdaptor(aAppUi);
      CleanupStack::PushL(self);
      self->ConstructL();
      return self;
      }
    
    CAudioPlayerAdaptor::~CAudioPlayerAdaptor()
      {
      PlayCleanup();
      }
    
    void CAudioPlayerAdaptor::SetFileL()
      {
      
      }
    
    void CAudioPlayerAdaptor::StartPlay()
      {
      CFileLogger::WriteLogL(_L("StartPlay()"));
      if(iState == EIdle && iWantToPlay)
        {
        iAuPlayUtil->Close();
        iState = EPrepare;
        iWantToPlay = ETrue;
        CFileLogger::WriteLogL(_L("Before OpenURL"));
    iAuPlayUtil->OpenUrlL(_L("rtsp://rmlive.bbc.co.uk/bbc-rbs/rmlive/ev7/live24/radio1/live/r1_dsat_g2.ra"));
        
        }
      else if(iState == EPaused && iWantToPlay)
        {
        iAuPlayUtil->Play();
        iState = EPlaying;
        }
      }
    
    void CAudioPlayerAdaptor::PausePlay()
      {
      if(iState == EPlaying)
        {
        CFileLogger::WriteLogL(_L("Pause()"));
        iAuPlayUtil->Pause();
        iState = EPaused;
        User::InfoPrint(_L("Pause"));
        }
      }
    
    void CAudioPlayerAdaptor::StopPlay()
      {
      CFileLogger::WriteLogL(_L("Stop()"));
      if(iAuPlayUtil)
        {
        iAuPlayUtil->Stop();
        iAuPlayUtil->Close();
        }
      PlayCleanup();
      iState = EIdle;
      iWantToPlay = EFalse;
      User::InfoPrint(_L("Stop"));
      }
    
    void CAudioPlayerAdaptor::ViewConstructL()
      {
      iAuFolderPath = KInitFolderPath;
      iAuFilePath = KInitAudioPath;
      }
    
    
    CAudioPlayerAdaptor::CAudioPlayerAdaptor(CAudioStreamAppUi* aAppUi)
      : iAuPlayUtil(0), iVolume(KMaxSound), iState(EIdle), iDialogLock(EFalse),
      iAuFolderPath(0), iAuFilePath(0), iWantToPlay(EFalse)
      {
      iAppUi = aAppUi;
      }
    
    void CAudioPlayerAdaptor::ConstructL()
      {
       CFileLogger::WriteLogL(_L(""));
       CFileLogger::WriteLogL(_L("Audio Streaming Example"));
          
       TRAPD(err, 
    	iAuPlayUtil = CMdaAudioPlayerUtility::NewL(*this, EMdaPriorityMax, EMdaPriorityPreferenceTimeAndQuality);
    		);
    void CAudioPlayerAdaptor::MapcInitComplete(TInt aError,
                                                const TTimeIntervalMicroSeconds& aDuration)
      {
      TBuf<100> log;
      _LIT(Klog, "MapcInitComplete");
      CFileLogger::WriteLogL(Klog);
      if(aError != KErrNone)
        {
          _LIT(Klog1, "MapcInitComplete Error: ");
          log.Copy(Klog1);
          log.AppendNum(aError);
          CFileLogger::WriteLogL(log);
          //TBuf<20> errBuf;
          //errBuf.Num(aError);
          PlayCleanup();
        }
      else
        {
    	  TRAPD(Err1, iAuPlayUtil->SetVolume(iVolume););
    	  _LIT(Klog1, "SetVolume Error: ");
    	        log.Copy(Klog1);
    	        log.AppendNum(Err1);
    	        CFileLogger::WriteLogL(log);
    	        
        TRAPD(Err,iAuPlayUtil->Play(););
        _LIT(Klog2, "Play Error: ");
              log.Copy(Klog2);
              log.AppendNum(Err);
              CFileLogger::WriteLogL(log);
              
        iState = EPlaying;
        }
      }
    void CAudioPlayerAdaptor::MapcPlayComplete(TInt aError)
      {
       TBuf<200> log;
       _LIT(Klog, "MapcPlayComplete Error: ");
       log.Copy(Klog);
       log.AppendNum(aError);
       CFileLogger::WriteLogL(log);
       
      if(aError != KErrNone)
        {
        TBuf<20> errBuf;
        errBuf.Num(aError);
        //iEikonEnv->InfoWinL(_L("MapcPlayComplete err:"), errBuf);
        }
      PlayCleanup();
      }
    
    void CAudioPlayerAdaptor::PlayCleanup()
      {
      if(iAuPlayUtil)
        {
        delete iAuPlayUtil;
        iAuPlayUtil = NULL;
        }
      iState = EIdle;
      iWantToPlay = EFalse;
      }
    
    void CAudioPlayerAdaptor::ShowError(TInt aErr)
      {
      _LIT(KErrInfo, "Err: %d");
      TBuf<20> errInfo;
      errInfo.Format(KErrInfo, aErr);
      User::InfoPrint(errInfo);
      }
    
    void CAudioPlayerAdaptor::MaloLoadingStarted()
    	{
    	CFileLogger::WriteLogL(_L("CAudioPlayerAdaptor::MaloLoadingStarted()"));
    	}
    
    void CAudioPlayerAdaptor::MaloLoadingComplete()
    	{
    	CFileLogger::WriteLogL(_L("CAudioPlayerAdaptor::MaloLoadingComplete()"));
    	}

Similar Threads

  1. problem in Auto starting application in s60_2nd_fp3
    By gaurav.gupta in forum Symbian
    Replies: 14
    Last Post: 2009-04-30, 11:09
  2. Call for webkit GUI and application engine model
    By yant in forum Symbian User Interface
    Replies: 1
    Last Post: 2009-04-16, 10:04
  3. 3250: Too many SMSs received crash the application
    By kewldeep in forum Mobile Java General
    Replies: 4
    Last Post: 2007-01-27, 00:00
  4. Application without icon in application menu
    By iulian_moldovan in forum Symbian
    Replies: 3
    Last Post: 2006-12-14, 09:38

Posting Permissions

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