can you please share with us the basic and correct lines on which we should start our study for making an mp3 player .
1) like we have an mp3 file (called source in MMF) 2) now we need to extract the data from mp3 file and change it into pcm8 or pcm 16 that symbian can play (this part would be called codec plugin in MMF i think )
but how do we extract the audio type and data , and covert it to pcm from an mp3 file .
any help or suggestion will be appreciated , thanks .
For play mp3, i think, we need a particoular api/plugin for able it to play sound mp3. Someone know which api? ...there is audiere, but for use it i need to rebuild it all...is there any api? Help! Thanks
Re: How to playing MP3 file with Series 60 SDK2.1 ?
hi , i converted Mp3 file into PCM16 format using LibMad. can anyone tell me how to play this one? when i tried to play it using writeL method of CMdaAudioOutputStream, it will take 8bit data as input. how to convert from 16 to 8 bit data? thanks in advance. Ramakrishna.
Re: How to playing MP3 file with Series 60 SDK2.1 ?
with Series 60 paltform 2 feature pack 1, the MP3 is supported nativly by the devices. So just use the normal player/recorder class to play the files. Do not even think on trying to rcord with the MP3 format, also it propably wont work on emulator, so try it directly on the target device.
Re: How to playing MP3 file with Series 60 SDK2.1 ?
Hi Yucca, i am using series 60 v 2.0 FP2. on emulator it is giving "File Not Found" error while i tried to play Mp3 file. Mp3 file is there at the location. pl let me give some suggession regarding the same. Thanks in advance. Regards, Ramakrishna.
does CMdaAudioPlayerUtility::OpenUrlL supports http:// u
I am using SDK2.0 FP2 When ever I try to Play a mp3 file form my server using OpenUrlLÂ it giving error(-5Â Openration not supported).If I give a dummy rtsp:// url it giving error(-1 Object not found).
1. does CMdaAudioPlayerUtility::OpenUrlL supports http:// urls. 2. does CMdaAudioPlayerUtility::OpenUrlLÂ supports rtsp://Â urls.
Re: How to playing MP3 file with Series 60 SDK2.1 ?
I've also tested this logic on my Nokia 6620. Hope it helps out. My code example below downloads the mp3 file from a website passing in a number of variables. Something like this:
/** * * @author js * @version */ public class PlayerForm extends Form implements CommandListener, ItemStateListener, Runnable { Display d = null; List p = null; String media = null; Player player = null; VolumeControl vc; /** * constructor */ public PlayerForm(Display _d, List _p, String c) { super("Media Player Preview"); //append("Sample Text Item"); try { d = _d; p = _p; media = c; // Set up this form to listen to command events setCommandListener(this); // Set up this form to listen to changes in the internal state of its interactive items setItemStateListener(this); // Add the Exit command addCommand(new Command("Stop", Command.EXIT, 0)); addCommand(new Command("Back", Command.EXIT, 1)); new Thread(this).start(); } catch(Exception e) { d.setCurrent( new Alert("Error", e.getMessage(),null, AlertType.ERROR) ); } }
public void run() { try { HttpConnection conn = (HttpConnection)Connector.open(media, Connector.READ_WRITE); InputStream is = conn.openInputStream(); player = Manager.createPlayer(is,"audio/mpeg");
player.realize(); // get volume control for player and set volume to max vc = (VolumeControl) player.getControl("VolumeControl"); if(vc != null) { vc.setLevel(100); } // the player can start with the smallest latency player.prefetch(); // non-blocking start player.start(); } catch(Exception e) { d.setCurrent( new Alert("Error", e.getMessage(),null, AlertType.ERROR) ); } }
/** * Called when user action should be handled */ public void commandAction(Command command, Displayable displayable) { String s = command.getLabel(); if( s.equals("Back") ) { d.setCurrent(p); } if( s.equals("Stop") ) { try { player.stop(); } catch(Exception e) { d.setCurrent( new Alert("Preview Error", e.getMessage(),null, AlertType.ERROR) ); } } }
/** * Called when internal state of any item changed */ public void itemStateChanged(Item item) { }
}
Read through the run method which is called from the the constructor. The entire object is a class Form. I hope that this will help someone somewhere out there. Thanks.
Re: How to playing MP3 file with Series 60 SDK2.1 ?
Concerning the Problems with the CMdaAudioPlayerUtility::OpenUrlL function: Nokia claims here that it is not implemented. I am now implementing dowloading it first and playing it afterwards using OpenFileL().
Forum posts: 22
MP3 is not supported by default. You may have to include MP3 format and codec plugin before using it.
-void*
Forum posts: 7
Thanks for the answer, but where I can get the MP3 codec plugin that you purpose? Sorry if my English is not good.
Thanks again,
Cindul
Forum posts: 78
can you please share with us the basic and correct lines on which we should start our study for making an mp3 player .
1) like we have an mp3 file (called source in MMF)
2) now we need to extract the data from mp3 file and change it into pcm8 or pcm 16 that symbian can play (this part would be called codec plugin in MMF i think )
but how do we
extract the audio type and data , and covert it to pcm from an mp3 file .
any help or suggestion will be appreciated , thanks .
Forum posts: 3
Someone know which api?
...there is audiere, but for use it i need to rebuild it all...is there any api?
Help!
Thanks
Forum posts: 29
i converted Mp3 file into PCM16 format using LibMad.
can anyone tell me how to play this one?
when i tried to play it using writeL method of CMdaAudioOutputStream, it will take 8bit data as input.
how to convert from 16 to 8 bit data?
thanks in advance.
Ramakrishna.
Forum posts: 17
Forum posts: 142
yucca
Forum posts: 29
i am using series 60 v 2.0 FP2. on emulator it is giving "File Not Found" error while i tried to play Mp3 file.
Mp3 file is there at the location. pl let me give some suggession regarding the same.
Thanks in advance.
Regards,
Ramakrishna.
Forum posts: 17
Forum posts: 29
Regards,
Ramakrishna.
Forum posts: 17
When ever I try to Play a mp3 file form my server using OpenUrlLÂ it giving error(-5Â Openration not supported).If I give a dummy rtsp:// url it giving error(-1 Object not found).
1. does CMdaAudioPlayerUtility::OpenUrlL supports http:// urls.
2. does CMdaAudioPlayerUtility::OpenUrlLÂ supports rtsp://Â urls.
Forum posts: 127
Are you using emulator or device? I guess using emulator won't work because of shitty ethernet plugin.
Forum posts: 1
I've also tested this logic on my Nokia 6620. Hope it helps out.
My code example below downloads the mp3 file from a website passing in a number of variables. Something like this:
http://www.mymp3.com/request.php?field1=1&field2=var&field3=rt700
This is suppose to return the actual mp3 file and the code below is how it handles it.
/*
* PlayerForm.java
*
* Created on August 30, 2005, 8:08 AM
*/
package ark;
import javax.microedition.lcdui.*;
import javax.microedition.media.*;
import javax.microedition.io.*;
import java.io.*;
import javax.microedition.media.control.VolumeControl;
import javax.microedition.io.HttpConnection;
import javax.microedition.io.Connector;
/**
*
* @author js
* @version
*/
public class PlayerForm extends Form implements CommandListener, ItemStateListener, Runnable
{
Display d = null;
List p = null;
String media = null;
Player player = null;
VolumeControl vc;
/**
* constructor
*/
public PlayerForm(Display _d, List _p, String c)
{
super("Media Player Preview");
//append("Sample Text Item");
try
{
d = _d;
p = _p;
media = c;
// Set up this form to listen to command events
setCommandListener(this);
// Set up this form to listen to changes in the internal state of its interactive items
setItemStateListener(this);
// Add the Exit command
addCommand(new Command("Stop", Command.EXIT, 0));
addCommand(new Command("Back", Command.EXIT, 1));
new Thread(this).start();
}
catch(Exception e)
{
d.setCurrent( new Alert("Error", e.getMessage(),null, AlertType.ERROR) );
}
}
public void run()
{
try
{
HttpConnection conn = (HttpConnection)Connector.open(media, Connector.READ_WRITE);
InputStream is = conn.openInputStream();
player = Manager.createPlayer(is,"audio/mpeg");
player.realize();
// get volume control for player and set volume to max
vc = (VolumeControl) player.getControl("VolumeControl");
if(vc != null)
{
vc.setLevel(100);
}
// the player can start with the smallest latency
player.prefetch();
// non-blocking start
player.start();
}
catch(Exception e)
{
d.setCurrent( new Alert("Error", e.getMessage(),null, AlertType.ERROR) );
}
}
/**
* Called when user action should be handled
*/
public void commandAction(Command command, Displayable displayable)
{
String s = command.getLabel();
if( s.equals("Back") )
{
d.setCurrent(p);
}
if( s.equals("Stop") )
{
try
{
player.stop();
}
catch(Exception e)
{
d.setCurrent( new Alert("Preview Error", e.getMessage(),null, AlertType.ERROR) );
}
}
}
/**
* Called when internal state of any item changed
*/
public void itemStateChanged(Item item)
{
}
}
Read through the run method which is called from the the constructor. The entire object is a class Form. I hope that this will help someone somewhere out there.
Regards,
J
Forum posts: 1
Concerning the Problems with the CMdaAudioPlayerUtility::OpenUrlL function: Nokia claims here that it is not implemented. I am now implementing dowloading it first and playing it afterwards using OpenFileL().