<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.newlc.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>NewLC - How to play mp3 file just like a wav file ? - Comments</title>
 <link>http://www.newlc.com/en/forum/how-play-mp3-file-just-wav-file</link>
 <description>Comments for &quot;How to play mp3 file just like a wav file ?&quot;</description>
 <language>en</language>
<item>
 <title>How to play mp3 file in UIQ 3.1 Symbian 9.2 via audio stream?</title>
 <link>http://www.newlc.com/en/forum/how-play-mp3-file-just-wav-file#comment-45046</link>
 <description>&lt;p&gt;Hi,&lt;br /&gt;
I m trying to play an mp3 file in symbian 9.2 by CMdaAudioOutputStream.&lt;br /&gt;
I m following these steps:&lt;br /&gt;
1. iAudioOutputStream = CMdaAudioOutputStream::NewL(*this);&lt;/p&gt;

&lt;p&gt;   iAudioSettings.Query();&lt;br /&gt;
    iAudioSettings.iChannels=TMdaAudioDataSettings::EChannelsMono;      &lt;br /&gt;
    iAudioSettings.iSampleRate=TMdaAudioDataSettings::ESampleRate8000Hz; &lt;/p&gt;

&lt;p&gt;iAudioOutputStream-&gt;Open(&amp;iAudioSettings);&lt;/p&gt;

&lt;p&gt;in callback MaoscOpenComplete() follwoing r implemented:&lt;/p&gt;

&lt;p&gt;iDataType.Set(KMMFFourCCCodeMP3);&lt;br /&gt;
iAudioOutputStream-&gt;SetDataTypeL(iDataType);&lt;br /&gt;
iAudioOutputStream-&gt;SetPriority(EMdaPriorityMax  , EMdaPriorityPreferenceTimeAndQuality);&lt;/p&gt;

&lt;p&gt;After these I call:&lt;br /&gt;
iAudioOutputStream-&gt;WriteL(iBuffer);&lt;/p&gt;

&lt;p&gt;Then&lt;br /&gt;
MaoscBufferCopied() is called with 0 error&lt;/p&gt;

&lt;p&gt;but MaoscPlayComplete()&lt;br /&gt;
is called with -10&lt;/p&gt;

&lt;p&gt;Please help&lt;/p&gt;

&lt;p&gt;Thanks&lt;br /&gt;
Regards&lt;/p&gt;</description>
 <pubDate>Wed, 12 Mar 2008 07:34:07 +0100</pubDate>
 <dc:creator>anand_zain76</dc:creator>
 <guid isPermaLink="false">comment 45046 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: How to play mp3 file just like a wav file ?</title>
 <link>http://www.newlc.com/en/forum/how-play-mp3-file-just-wav-file#comment-43684</link>
 <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Make sure that the file exists and the path specified is the correct one. The error in &quot;MapcInitComplete&quot; suggests that probably the file can not be found in the specified path.&lt;br /&gt;
Make sure that your app is having the required capability to read from &quot;\sys&quot; folder.&lt;/p&gt;</description>
 <pubDate>Mon, 31 Dec 2007 06:38:34 +0100</pubDate>
 <dc:creator>raghav_an</dc:creator>
 <guid isPermaLink="false">comment 43684 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: How to play mp3 file just like a wav file ?</title>
 <link>http://www.newlc.com/en/forum/how-play-mp3-file-just-wav-file#comment-42135</link>
 <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I have posted the following code....Plz help me in playing the mp3 file.....&lt;/p&gt;

&lt;p&gt;Thanks..&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;When i debugged the following function i got the value of aError -1&lt;/span&gt;&lt;br /&gt;
void CSoundPlayer::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds&amp; /*aDuration*/)&lt;br /&gt;
{&lt;br /&gt;
    iState = aError ? ENotReady : EReady;&lt;br /&gt;
}&lt;br /&gt;
&lt;span style=&quot;font-weight:bold&quot;&gt;Passing sound file...&lt;/span&gt;&lt;br /&gt;
void CSortingMainViewContainer::ConstructL(const TRect&amp; aRect)&lt;br /&gt;
    {&lt;br /&gt;
    CreateWindowL();&lt;br /&gt;
    if (!pSound)&lt;br /&gt;
    {&lt;br /&gt;
    	pSound=CSoundPlayer::NewL(_L(&quot;C:\\system\\Apps\\Sound\\bkj.mp3&quot;));//Getting the sound file path &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;span style=&quot;font-weight:bold&quot;&gt;Code to play the sound file...&lt;/span&gt;&lt;br /&gt;
TKeyResponse CSortingMainViewContainer::OfferKeyEventL(&lt;br /&gt;
		const TKeyEvent&amp; aKeyEvent,TEventCode aType)&lt;br /&gt;
 { &lt;br /&gt;
 switch(MainMenu-&gt;MenuItemHandler(aKeyEvent,aType,AppUI))&lt;br /&gt;
 {&lt;br /&gt;
 	&lt;br /&gt;
 	case KMenuOne:&lt;br /&gt;
 	{&lt;br /&gt;
 		if(pSound)&lt;br /&gt;
		    {&lt;br /&gt;
		    	pSound-&gt;PlayL();//play sound file&lt;br /&gt;
		    }&lt;br /&gt;
 		break;&lt;br /&gt;
 	}&lt;br /&gt;
 	case KMenuTwo:&lt;br /&gt;
 	{&lt;br /&gt;
 		pSound-&gt;StopL();&lt;br /&gt;
 		AppUI-&gt;ActivateLocalViewL (TUid::Uid(ESortingGameViewId1));&lt;br /&gt;
 		break;&lt;br /&gt;
 	}&lt;br /&gt;
 	default:&lt;br /&gt;
 	break;&lt;br /&gt;
 }&lt;br /&gt;
 	&lt;br /&gt;
 	return EKeyWasNotConsumed;&lt;br /&gt;
 //	return CCoeControl::OfferKeyEventL(aKeyEvent, aType);&lt;br /&gt;
 }&lt;br /&gt;
&lt;span style=&quot;font-weight:bold&quot;&gt;Functions of  CSoundPlayer class&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;CSoundPlayer* CSoundPlayer::NewL(const TDesC&amp; aFile)&lt;br /&gt;
{&lt;br /&gt;
    CSoundPlayer* self = NewLC(aFile);&lt;br /&gt;
    CleanupStack::Pop(self);&lt;br /&gt;
    return self;&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;    &lt;br /&gt;
CSoundPlayer* CSoundPlayer::NewLC(const TDesC&amp; aFile)&lt;br /&gt;
{&lt;br /&gt;
    CSoundPlayer* self = new (ELeave) CSoundPlayer();&lt;br /&gt;
    CleanupStack::PushL(self);&lt;br /&gt;
    self-&gt;ConstructL(aFile);&lt;br /&gt;
    return self;&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;CSoundPlayer::CSoundPlayer()&lt;br /&gt;
{&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;CSoundPlayer::~CSoundPlayer()&lt;br /&gt;
{&lt;br /&gt;
    delete iMdaPlayer;    &lt;br /&gt;
    iMdaPlayer = NULL;&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;void CSoundPlayer::ConstructL(const TDesC&amp; aFile)&lt;br /&gt;
{&lt;br /&gt;
  if (!iMdaPlayer)&lt;br /&gt;
    {&lt;br /&gt;
    	iMdaPlayer=CMdaAudioPlayerUtility::NewFilePlayerL(aFile,*this,EMdaPriorityMax);      &lt;br /&gt;
    }&lt;br /&gt;
  &lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;void CSoundPlayer::RepeatL()&lt;br /&gt;
{&lt;br /&gt;
	if (iMdaPlayer)&lt;br /&gt;
	{&lt;br /&gt;
		iMdaPlayer-&gt;SetRepeats(1, TTimeIntervalMicroSeconds(1));&lt;br /&gt;
	}&lt;br /&gt;
    &lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;void CSoundPlayer::PlayL()&lt;br /&gt;
{&lt;br /&gt;
    if(iState==EReady)&lt;br /&gt;
    {&lt;br /&gt;
        iState=EPlaying;&lt;br /&gt;
        iMdaPlayer-&gt;Play();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;void CSoundPlayer::StopL()&lt;br /&gt;
{&lt;br /&gt;
    if(iState==EPlaying)&lt;br /&gt;
    {&lt;br /&gt;
        iMdaPlayer-&gt;Stop();&lt;br /&gt;
        iState = EReady;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;// from MMdaAudioPlayerCallback&lt;br /&gt;
void CSoundPlayer::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds&amp; /*aDuration*/)&lt;br /&gt;
{&lt;br /&gt;
    iState = aError ? ENotReady : EReady;&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;void CSoundPlayer::MapcPlayComplete(TInt aError)&lt;br /&gt;
{&lt;br /&gt;
    iState = aError ? ENotReady : EReady;&lt;br /&gt;
}&lt;/p&gt;</description>
 <pubDate>Tue, 09 Oct 2007 09:01:52 +0200</pubDate>
 <dc:creator>brajesh1983</dc:creator>
 <guid isPermaLink="false">comment 42135 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: How to play mp3 file just like a wav file ?</title>
 <link>http://www.newlc.com/en/forum/how-play-mp3-file-just-wav-file#comment-42120</link>
 <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;What is the result of the call &quot;CMdaAudioPlayerUtility::NewFilePlayerL()&quot;. &lt;br /&gt;
This should generate a callback &quot;MMdaAudioPlayerCallback::MapcInitComplete() &quot; with aError=KErrNone. Inidicating the creation and initialization is successful.&lt;/p&gt;

&lt;p&gt;What is the error code you are getting in the callback method?&lt;/p&gt;

&lt;p&gt;The information you have provided is too little to say anything. If you post your complete (or may be relevant part of) code, you  may get some suggestions....&lt;/p&gt;

&lt;p&gt;Chao,&lt;br /&gt;
Ravi&lt;br /&gt;
&lt;/p&gt;</description>
 <pubDate>Mon, 08 Oct 2007 15:12:24 +0200</pubDate>
 <dc:creator>raghav_an</dc:creator>
 <guid isPermaLink="false">comment 42120 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: How to play mp3 file just like a wav file ?</title>
 <link>http://www.newlc.com/en/forum/how-play-mp3-file-just-wav-file#comment-41785</link>
 <description>&lt;p&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;Hi eric,&lt;/p&gt;

&lt;p&gt;I want to play a mp3 file on my Nokia N72 phone....as i think it support mp3 file.&lt;/p&gt;

&lt;p&gt;if i pass the mp3 file in the following function as shown below will it play the mp3 file?&lt;/p&gt;

&lt;p&gt;iMdaPlayer=CMdaAudioPlayerUtility::NewFilePlayerL(_L(&quot;C:\\system\\Apps\\Sound\\play.mp3&quot;),*this,EMdaPriorityMax);    &lt;/span&gt;&lt;/p&gt;</description>
 <pubDate>Tue, 25 Sep 2007 13:40:40 +0200</pubDate>
 <dc:creator>brajesh1983</dc:creator>
 <guid isPermaLink="false">comment 41785 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: How to play mp3 file just like a wav file ?</title>
 <link>http://www.newlc.com/en/forum/how-play-mp3-file-just-wav-file#comment-41768</link>
 <description>&lt;p&gt;&lt;div class=&quot;bb-quote&quot;&gt;&lt;blockquote class=&quot;bb-quote-body&quot;&gt;the code does not work.&lt;/blockquote&gt;&lt;/div&gt;&lt;br /&gt;
What do you mean by the code does not work? It crashes ? it just output gargabe or nothing ? it return an error code ?&lt;br /&gt;
Are you sure that your phone can play your MP3 file ?&lt;/p&gt;

&lt;p&gt;And maybe you can also post your code instead of requesting some... it would help more people and someone might find why it does not work.&lt;/p&gt;</description>
 <pubDate>Mon, 24 Sep 2007 17:43:31 +0200</pubDate>
 <dc:creator>eric</dc:creator>
 <guid isPermaLink="false">comment 41768 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: How to play mp3 file just like a wav file ?</title>
 <link>http://www.newlc.com/en/forum/how-play-mp3-file-just-wav-file#comment-41760</link>
 <description>&lt;p&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;Hi Sysctl-forum,&lt;/p&gt;

&lt;p&gt;Actually i am able to play the WAV file in the mobile phone but when i want to play the mp3 file, the code does not work.&lt;br /&gt;
So i think there is some other way to play the mp3 file thats why i need a sample project to play mp3 file...&lt;/p&gt;

&lt;p&gt;Thanks for help...&lt;/p&gt;

&lt;p&gt;Brajesh....&lt;/span&gt;&lt;/p&gt;</description>
 <pubDate>Mon, 24 Sep 2007 14:04:43 +0200</pubDate>
 <dc:creator>brajesh1983</dc:creator>
 <guid isPermaLink="false">comment 41760 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: How to play mp3 file just like a wav file ?</title>
 <link>http://www.newlc.com/en/forum/how-play-mp3-file-just-wav-file#comment-41743</link>
 <description>&lt;p&gt;Exactly like you would play a WAV file. Since you mentioned in your post that you know how to do it, I thought you do not need the code. For examples, look at &lt;a href=&quot;http://opensource.nokia.com/projects/s60internetradio/index.html&quot; class=&quot;bb-url&quot;&gt;Nokia S60 Internet Radio&lt;/a&gt;.&lt;/p&gt;</description>
 <pubDate>Mon, 24 Sep 2007 09:16:23 +0200</pubDate>
 <dc:creator>sysctl-forum</dc:creator>
 <guid isPermaLink="false">comment 41743 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: How to play mp3 file just like a wav file ?</title>
 <link>http://www.newlc.com/en/forum/how-play-mp3-file-just-wav-file#comment-41721</link>
 <description>&lt;p&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;hi thanks for the help but i request you to please post the sample code to play mp3 file......&lt;/p&gt;

&lt;p&gt;thank u&lt;/p&gt;

&lt;p&gt;brajesh&lt;/span&gt;&lt;/p&gt;</description>
 <pubDate>Sat, 22 Sep 2007 09:03:48 +0200</pubDate>
 <dc:creator>brajesh1983</dc:creator>
 <guid isPermaLink="false">comment 41721 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: How to play mp3 file just like a wav file ?</title>
 <link>http://www.newlc.com/en/forum/how-play-mp3-file-just-wav-file#comment-41719</link>
 <description>&lt;p&gt;If you are using &lt;a href=&quot;http://www.symbian.com/developer/techlib/v9.1docs/doc_source/reference/reference-cpp/N10296/CMdaAudioOutputStreamClass.html&quot; class=&quot;bb-url&quot;&gt;CMdaAudioOutputStream&lt;/a&gt; to play PCM data, you can play MP3 data by calling &lt;a href=&quot;http://www.symbian.com/developer/techlib/v9.1docs/doc_source/reference/reference-cpp/N10296/CMdaAudioOutputStreamClass.html#%3a%3aCMdaAudioOutputStream%3a%3aSetDataTypeL%28%29&quot; class=&quot;bb-url&quot;&gt;CMdaAudioOutputStream::SetDataTypeL(TFourCC aAudioType)&lt;/a&gt; with KMMFFourCCCodeMP3.&lt;/p&gt;</description>
 <pubDate>Sat, 22 Sep 2007 06:08:07 +0200</pubDate>
 <dc:creator>sysctl-forum</dc:creator>
 <guid isPermaLink="false">comment 41719 at http://www.newlc.com</guid>
</item>
<item>
 <title>How to play mp3 file just like a wav file ?</title>
 <link>http://www.newlc.com/en/forum/how-play-mp3-file-just-wav-file</link>
 <description>&lt;p&gt;[b]Hi,&lt;/p&gt;

&lt;p&gt;I want to play a mp3 file as a background music in my application not a wav file.But the problem is that when i searched the article about to play the mp3 file then it says to decode the mp3 file and there is a long process to decode the mp3 file, so is not any simpler way to play mp3 file like playing the wav file because playing wav file is much easier.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.newlc.com/en/forum/how-play-mp3-file-just-wav-file&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.newlc.com/en/forum/how-play-mp3-file-just-wav-file#comments</comments>
 <category domain="http://www.newlc.com/en/forums/audio">Audio</category>
 <pubDate>Fri, 21 Sep 2007 09:39:25 +0200</pubDate>
 <dc:creator>brajesh1983</dc:creator>
 <guid isPermaLink="false">19039 at http://www.newlc.com</guid>
</item>
</channel>
</rss>
