| Reply | « Previous Thread | Next Thread » |
|
Hi, I want to access to a audio file with carbide emulator but I'dont know where I must put it. I'm able to access to an image but with audio file don't work.
The code for image: Code:
FileConnection fileConn = (FileConnection)Connector.open(imgName, Connector.READ);
// load the image data in memory
// Read data in CHUNK_SIZE chunks
InputStream fis = fileConn.openInputStream();
long overallSize = fileConn.fileSize();
int length = 0;
byte[] imageData = new byte[0];
while (length < overallSize) {
byte[] data = new byte[CHUNK_SIZE];
int readAmount = fis.read(data, 0, CHUNK_SIZE);
byte[] newImageData = new byte[imageData.length + CHUNK_SIZE];
System.arraycopy(imageData, 0, newImageData, 0, length);
System.arraycopy(data, 0, newImageData, length, readAmount);
imageData = newImageData;
length += readAmount;
}
fis.close();
fileConn.close();
if (length > 0) {
currentImage = Image.createImage(imageData, 0, length);
}
//currentImage=zoomIn(currentImage);
repaint();
Code for audio file: Code:
String url = "file:///E:/folder/file.amr"; player = Manager.createPlayer(url); This work fine on device but not on emulator. Thanks |
|
Join Date: Oct 2005
Posts: 1,149
Location: Hyderabad,India
Offline
Super Contributor
|
|
|
Quote:
Hope that helps. Priju |
| Priju Jacob Paul |
| View Public Profile |
| Find all posts by Priju Jacob Paul |
|
Yes it is present into folder
C:\Nokia\Devices\Nokia_Prototype_SDK_4_0\devices\Prototype_4_0_S60_MIDP_Emulator\bin\Storage\Default\e\ This is the E:\\ on device. I think there is an error while taking the InputStream because the url is correct while displaying an image.
Last edited by zidia : 2007-03-30 at 11:22.
|
|
I feel this thread has the solution u are looking for. Even i ahve worked with CcarbideJ and S60 Emulator
http://discussion.forum.nokia.com/fo...d.php?t=102988 with regards, Khalandar Pasha N (khalandar_p@yahoo.co.in) |
|
Thanks but this thread didn't help me.
I'putted both audio and image files into: C:\Nokia\Devices\Nokia_Prototype_SDK_4_0\devices\Prototype_4_0_S60_MIDP_Emulator\bin\Storage\Default\e\myFolder\ and the urls are: Code:
url="file:///E:/myFolder/a.amr" url="file:///E:/myFolder/a.jpg" For audio I tried with Code:
player = Manager.createPlayer(url); Code:
FileConnection fileConn = FileConnection)Connector.open(url,Connector.READ); InputStream fis = fileConn.openInputStream(); String ctype = "audio/amr"; player = Manager.createPlayer(fis,ctype); Code:
InputStream is = this.getClass().getResourceAsStream(url); Player player = Manager.createPlayer(is, "audio/amr"); Thanks |
|
Quote:
Ur using Eclipse or Netbeans? I have the code for WTK2.5 if u want can share it with you?? with regards, Khalandar Pasha N (khalandar_p@yahoo.co.in) |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Theme Studio 3.1 not creating themes | zemm | Themes/Carbide.ui | 11 | 2008-10-18 09:41 |
| S60 theme questions | Nokian_Spb | Symbian Media (Graphics & Sounds) | 3 | 2006-08-17 07:11 |
| Tips on using NDS 1.1 | mitts | Symbian Tools & SDKs | 7 | 2006-01-18 17:07 |
| 9210 emulator: Internet access advanced settings crashes | twaltari | Symbian Tools & SDKs | 0 | 2002-09-02 08:37 |
| how can I open and test a compiled help file in the nokia 9210 emulator? | rubyyogaswara | Symbian Tools & SDKs | 0 | 2002-08-29 06:09 |