I want to play streamed mp3 in my S60 2nd edition phones like 7610 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
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.
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.
I was able to play one mp3 file quite well but was bit too slow. CMMFCodec provides a ConfigureL function with which u can change the settings of the decoder. But it ask for the UID of the decoder as the first parameter. I dont know what should be the UID of the mp3 decoder. It I would had been deoding ARM to pcm then it would be KAdvancedUidCodecAMRToPCM16 = 0x101FAF67;
But since for mp3 there is no such value defined for the decoder in mmfcodecimplementationuids.hrh I have initailised the codec using two values of TFourCC.
Do anyone have any idea as how we can change the settings of the mp3 decoder available in s60 2.1 phones. I have gone through all the forums but didn,t find any usefull information. It would be very helpfull if anyone can provide some information in this poorly documented topic.
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?
I can try to give u the answer. There are two types of codecs one is the hardware codec and another is the software codecs. I think in Series 60 Fp2 phones and above there is an mp3 harware codec available and this may be the reason why it can directly play mp3 with the help of its CMdaAudioOutputStream class. There may be no sofware mp3 codec available in this phones. Whereas in S60 2.1 phones there are no harware mp3 codec available and hence may be nokia has implemented the software version of this codec by inheriting from CMMFCodec. Now when u use the CMMFCodec to initailse the codec by specifying the TFourCC values it loads the available codec. But when u try this on 6680 phone this will give not supported error because no software implementation of codec is available. And the hardware codecs are only accessible through the CMMFDevSound class. Since CMdaAudioOutputStream is a wrapper around the CMMFDevSound it can be directly used to play mp3 data. Dont know whether u can have access to this hardware codec with these API,s. I am able to use the CMMFCodec in 3230 but dont know how to configure the settings of the codec.
Santosh shetty, thank You for the answer, now I implemented audio converting from mp3 to 8000 Hz-16 bit wav file using madlib, and it's working perfectly on the emulator and 6680 phone. I have read about CMMFDevSound class in sdk docs, and I not found examples and maybe using of this class will hard and I think it take many time to implement audio conversing using this class.
However if somebody have experience of using this API please reply, as converting using std class is more appropriate for me.
I keep on asking same sort of questions on mp3 streaming etc, but didnt get single reply.
Santosh can i have pointers on CMMFCodec and CMMFDevSound, regarding hardware and software codecs. The playout is slow because you arent playing at same sample rate - its other thing that you cant set to something other. The codec inside is not doing resampling. I think the only way to make it working is todo resampling on converted PCM data.
I had same experince on my 6630 (kind of 668x phone) what Yarichello has mentioned. Yarichello how is madlib with VBR and stereo ?
I read somewhere that Nokia has declared CMMFDevSound as private api for newer Phones. So even we can do with CMMFDevSound, it wouldnt be fruitful. Its very surpressing that these core multimedia clases has no documentation.
Faiq, I dont know much about CMMFDevSound as the documentation is very bad and have also read that it is difficult to use it. Have read some posts in forum but nothing very usefull as such. CMdaAudioOutputStream and CMdaAudioInputStream are the wrapper around the CMMFDevSound. CMdaAudioOutputStream class in devices like 6630 can directly play mp3 data probably it uses the hardware implematation of mp3 codec. And u can use the hardware codec only through these classes. These devices I suppose dont have sofware implementation of mp3 hence may be Yarichello was getting not supported error.
In devices like 3230 there is software implementation of mp3 codec which is implemented by inhereting from CMMFCodec.
Faiq, I want to decode mp3 sample into pcm16 and give it to the output stream for playing in S60 2.1 devices like 3230. The major issues with these devices is that the output stream class can be opened with only 8KHz or 16KHz mono. I am using CCMFCodec to decode it to mp3. Can I change the setting of this inbuilt device codec so that it gives me 8KHz or 16Khz mono as the output so that I can play it through the outputstream class which supports only 8kHz and 16KHz mono. If this is not possible as u said that I had to do the resampling of the pcm data so that I get the required 8K or 16K. Are there any open source code avaiable to this resampling?
It would had been nice if I can change the settings of inbuilt codec by configureL to do decoding or otherway resample the output to genarate 8K or 16K mono output. If I go for a third party decoder like madlib does it provide me the flexibility to specify the required pcm output sample rate and channel. My need is the decoder should generate output at samplerate of 16KHz or 8Khz mono.
Forum posts: 17
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.
regards,
Santosh Shetty
Forum posts: 17
I am not able to play to play quality music using the inbuilt decoder in S60V2.1
I am decoding th mp3 to pcm16 using CMMFCodec.
CMMFCodec *iOCodec2 = CMMFCodec::NewL(srcDataType,dstDataType);
TFourCC dstDataType(KMMFFourCCCodePCM16); // 0x36315020
TFourCC srcDataType(KMMFFourCCCodeMP3); // 0x524d4120
I was able to play one mp3 file quite well but was bit too slow.
CMMFCodec provides a ConfigureL function with which u can change the settings of the decoder. But it ask for the UID of the decoder as the first parameter. I dont know what should be the UID of the mp3 decoder. It I would had been deoding ARM to pcm then it would be KAdvancedUidCodecAMRToPCM16 = 0x101FAF67;
But since for mp3 there is no such value defined for the decoder in mmfcodecimplementationuids.hrh I have initailised the codec using two values of TFourCC.
Do anyone have any idea as how we can change the settings of the mp3 decoder available in s60 2.1 phones. I have gone through all the forums but didn,t find any usefull information. It would be very helpfull if anyone can provide some information in this poorly documented topic.
regards,
Santosh Shetty
Forum posts: 17
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,
Santosh Shetty.
Forum posts: 34
I have tried to convert from mp3 to pcm16 using CMMFCodec but at creating of converter object i getting error KErrNotSupported on 6680 phone.
I using the same code as you:
TFourCC dstDataType(KMMFFourCCCodePCM16); // 0x36315020
TFourCC srcDataType(KMMFFourCCCodeMP3); // 0x524d4120
//At NewL instruction i get leave - KErNotSupported
CMMFCodec *iOCodec2 = CMMFCodec::NewL(srcDataType,dstDataType);
It some strange, that it worked on 3230 but dosn't work on 6680.
Are You have any ideas why i getting error?
There is a link to my posts with siimilar theme:
http://forum.newlc.com/index.php/topic,15220.0.html
Forum posts: 17
I can try to give u the answer. There are two types of codecs one is the hardware codec and another is the software codecs. I think in Series 60 Fp2 phones and above there is an mp3 harware codec available and this may be the reason why it can directly play mp3 with the help of its CMdaAudioOutputStream class. There may be no
sofware mp3 codec available in this phones. Whereas in S60 2.1 phones there are no harware mp3 codec available and hence may be nokia has implemented the software version of this codec by inheriting from CMMFCodec. Now when u use the CMMFCodec to initailse the codec by specifying the TFourCC values it loads the available codec. But when u try this on 6680 phone this will give not supported error because no software implementation of codec is available. And the hardware codecs are only accessible through the CMMFDevSound class. Since CMdaAudioOutputStream is a wrapper around the CMMFDevSound it can be directly used to play mp3 data. Dont know whether u can have access to this hardware codec with these API,s.
I am able to use the CMMFCodec in 3230 but dont know how to configure the settings of the codec.
regards,
Santosh Shetty.
Forum posts: 34
I have read about CMMFDevSound class in sdk docs, and I not found examples and maybe using of this class will hard and I think it take many time to implement audio conversing using this class.
However if somebody have experience of using this API please reply, as converting using std class is more appropriate for me.
Forum posts: 78
Good to see you guys.
I keep on asking same sort of questions on mp3 streaming etc, but didnt get single reply.
Santosh can i have pointers on CMMFCodec and CMMFDevSound, regarding hardware and software codecs.
The playout is slow because you arent playing at same sample rate - its other thing that you cant set to something other. The codec inside is not doing resampling. I think the only way to make it working is todo resampling on converted PCM data.
I had same experince on my 6630 (kind of 668x phone) what Yarichello has mentioned. Yarichello how is madlib with VBR and stereo ?
I read somewhere that Nokia has declared CMMFDevSound as private api for newer Phones. So even we can do with CMMFDevSound, it wouldnt be fruitful. Its very surpressing that these core multimedia clases has no documentation.
Kind Regards
Faiq
Forum posts: 17
Faiq, I dont know much about CMMFDevSound as the documentation is very bad and have also read that it is difficult to use it. Have read some posts in forum but nothing very usefull as such. CMdaAudioOutputStream and CMdaAudioInputStream are the wrapper around the CMMFDevSound. CMdaAudioOutputStream class in devices like 6630 can directly play mp3 data probably it uses the hardware implematation of mp3 codec. And u can use the hardware codec only through these classes. These devices I suppose dont have sofware implementation of mp3 hence may be Yarichello was getting not supported error.
In devices like 3230 there is software implementation of mp3 codec which is implemented by inhereting from CMMFCodec.
Faiq, I want to decode mp3 sample into pcm16 and give it to the output stream for playing in S60 2.1 devices like 3230. The major issues with these devices is that the output stream class can be opened with only 8KHz or 16KHz mono. I am using CCMFCodec to decode it to mp3. Can I change the setting of this inbuilt device codec so that it gives me 8KHz or 16Khz mono as the output so that I can play it through the outputstream class which supports only 8kHz and 16KHz mono. If this is not possible as u said that I had to do the resampling of the pcm data so that I get the required 8K or 16K.
Are there any open source code avaiable to this resampling?
It would had been nice if I can change the settings of inbuilt codec by configureL to do decoding or otherway resample the output to genarate 8K or 16K mono output. If I go for a third party decoder like madlib does it provide me the flexibility to specify the required pcm output sample rate and channel. My need is the decoder should generate output at samplerate of 16KHz or 8Khz mono.
regarsds,
Santosh Shetty