IT Community - Software Programming, Web Development and Technical Support

Symbian C++ Mp3 Streaming

This is a discussion on Symbian C++ Mp3 Streaming within the Symbian forums, part of the Mobile Software Development category; Hi, I want to play streamed mp3 in my S60 2nd edition phones like N70 and 3230. I am using ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > Mobile Software Development > Symbian

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 08-06-2007, 12:08 PM
prasannavigneshr prasannavigneshr is offline
D-Web Incredible
 
Join Date: Feb 2007
Posts: 1,316
prasannavigneshr is on a distinguished road
Send a message via MSN to prasannavigneshr
Question Symbian C++ Mp3 Streaming

Hi,

I want to play streamed mp3 in my S60 2nd edition phones like N70 and 3230.
I am using CMdaAudioOutputStream class. since in s60 2.1 phones,using this Api I can only play PCM data, I need to convert the mp3 data received from the network into pcm data. since this devices have and inbuilt MP3 decoder can i use the decoder to decode my mp3 data frame by frame? Using CMMFCodec once i succesfully converted from ARM to PCM using the ProcessL function. Can I use the framework to convert mp3 to PCM buffer by buffer using

CMMFCodec::NewL(KMMFFourCCCodeMP3, KMMFFourCCCodePCM16)

Or do I need to use a decoder like madlib. Ya in devices below S60 V2.1 Mp3 decoders are not available and I need to use a decoder.

regards,
__________________
Prasanna Vignesh
MCPD | Web Developer
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-08-2007, 01:42 AM
Venkat Venkat is offline
D-Web Master
 
Join Date: Mar 2007
Posts: 350
Venkat is on a distinguished road
Default Re: Symbian C++ Mp3 Streaming

not sure if this fit your requirements, but have you looked into the Nokia's open source internet radio project. It is infact playing MP3/AAC coded streams, and AFAIK the streaming engine implementation would also be free.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-08-2007, 02:03 AM
prasannavigneshr prasannavigneshr is offline
D-Web Incredible
 
Join Date: Feb 2007
Posts: 1,316
prasannavigneshr is on a distinguished road
Send a message via MSN to prasannavigneshr
Default Re: Symbian C++ Mp3 Streaming

hi,
I have seen the Nokia internet Radio project. But its basically for phones with 2nd edition FP2 and above which can directly play MP3 and AAC formats.
__________________
Prasanna Vignesh
MCPD | Web Developer
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-08-2007, 06:31 AM
prasannavigneshr prasannavigneshr is offline
D-Web Incredible
 
Join Date: Feb 2007
Posts: 1,316
prasannavigneshr is on a distinguished road
Send a message via MSN to prasannavigneshr
Default Re: Symbian C++ Mp3 Streaming

Hi,

I am able to use the inbuilt mp3 decoder in 3230. using CMMFCodec::NewL(KMMFFourCCCodeMP3, KMMFFourCCCodePCM16) but there are lots of issues. I am able to decode the mp3 buffer to PCM16.
I have taken the source and destination as a pointer to 8 bit descritor TDes8* and passing the destination buffer to WriteL function of output stream

I played a mp3 file with bitrate of 24kbps,stero and with audio sample rate of 11 Khz by reading little by little from a file and passing it to CMdaAudioOutputStream. The setting I used for the stream was ESampleRate16000Hz Mono. The music played fine but was bit too slow may be because I was playing stereo. But the probelm is that the stream only supports ESampleRate16000Hz Mono and ESampleRate8000Hz Mono

If I specify any other sample rate the following line fails with NotSupported error. Stereo is not supported at all.

iOutputStream->SetAudioPropertiesL(iSetting.iSampleRate,
iSetting.iChannels);

why does it supports only two sample rate and thats too not stereo? This devices have inbuilt mp3 decoder. So why cant we adjust the settings. because if I am decoding mp3 of various sample rate I cant play them satisfactorily with just ESampleRate16000Hz Mono.
__________________
Prasanna Vignesh
MCPD | Web Developer
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 08-09-2007, 03:54 AM
prasannavigneshr prasannavigneshr is offline
D-Web Incredible
 
Join Date: Feb 2007
Posts: 1,316
prasannavigneshr is on a distinguished road
Send a message via MSN to prasannavigneshr
Default Re: Symbian C++ Mp3 Streaming

hi,

plz provide some clue whether we can use the in built codec in S60 2.1 phones through CMMFCodec. I have used it and it works but dont know how to configure the codec. Or do I need to use a third party software codec?

regards
__________________
Prasanna Vignesh
MCPD | Web Developer
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 08-09-2007, 09:11 AM
bluesky bluesky is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 201
bluesky is on a distinguished road
Default Re: Symbian C++ Mp3 Streaming

Hi,

I am able to use the configureL function of the default mp3 codec but not to much success.
I used something like this,

RArray<TInt> configParams;

configParams.Append(1);
configParams.Append(0);
configParams.Append(0);
configParams.Append(0);
configParams.Append(0);
configParams.Append(0)

TUid codecId = TUid::Uid(KMmfUidControllerAudio);
iOCodec2->ConfigureL(codecId, (TDesC8&) configParams);

There are 6 parameters needed. If I give anything less than that it gives array out of bond index panic. Initially without configuring the decoder when i played a 11KHz mp3 song by decoding buffer by buffer and setting the output stream settings to 16KHz mono my song was too slow. But when I used the above setting the playing of song was bit too fast.
I dont know what these 6 parameters correspond to. I want to adjust these 6 parameters in such a way that it gives me 16KHz mono 16bit PCM sample for all my mp3 input. I havent come across any documentation about this.

regards,
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 08-09-2007, 09:56 AM
H2o H2o is offline
D-Web Analyst
 
Join Date: Jul 2007
Posts: 246
H2o is on a distinguished road
Default Re: Symbian C++ Mp3 Streaming

The solution for your problem..

Code:
RArray<TInt> configParams;

// This setup converts audio to 16000Hz 16 bit mono PCM
configParams.Append(1); // stereo to mono switch (TRUE(1) or default FALSE(0))
configParams.Append(0); // decode left or right channel (1 left, 2 right, 0 default all)
configParams.Append(1); // decimation factor (2, 4 or default 1)
configParams.Append(1); // error concealment level (0 none, default 1)
configParams.Append(16); // resolution of PCM samples (default 16 bits)
configParams.Append(16000); //Output sampling frequency

TUid codecId = TUid::Uid(KMmfUidControllerAudio);
iOCodec2->ConfigureL(codecId, (TDesC8&) configParams);
This should solve the problem of making audio being 'slow', but no guarentees.

Hope this helps
__________________
H2O

Without us, no one can survive..
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 08-09-2007, 10:19 AM
prasannavigneshr prasannavigneshr is offline
D-Web Incredible
 
Join Date: Feb 2007
Posts: 1,316
prasannavigneshr is on a distinguished road
Send a message via MSN to prasannavigneshr
Default Re: Symbian C++ Mp3 Streaming

It worked well.

regards,
__________________
Prasanna Vignesh
MCPD | Web Developer
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 08-09-2007, 10:32 AM
bluesky bluesky is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 201
bluesky is on a distinguished road
Default Re: Symbian C++ Mp3 Streaming

Hi H2o...

How did you know how to configure the mp3 decoder? There's no documentation anywhere that I can find....
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to programmatically set the wallpaper of Symbian s60 ? itbarota Mobile Software Development 2 08-06-2007 08:19 AM
How to format a Symbian Phone itbarota Mobile Software Development 3 08-06-2007 07:56 AM
What is the method for streaming transmission? H2o Other Web Programming Languages 1 07-20-2007 01:47 AM
video streaming nssukumar Flash Actionscript Programming 1 07-16-2007 06:53 AM
Info on Streaming Jeyaseelansarc Server Management 0 05-18-2007 01:48 AM


All times are GMT -7. The time now is 10:29 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0