| Reply | « Previous Thread | Next Thread » |
|
Hi
im using netbeans and S60 FP2 2nd from nokia and make a form and after this line // Insert post-init code here i write the following code to play wav file Code:
try {
Player p = null;
try {
p = Manager.createPlayer("myfile.wav");
} catch (MediaException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
}
p.start();
} catch (MediaException ex) {
ex.printStackTrace();
}
now where to put that wav file to run it? and what if i want to my program plays any wav file in the phone i mean apply my program to any wav file when i click on it? thanks in advance. |
|
as far as i know to play some predifiened wav file you has to put in inn res folder and if u want that user can select the file at run time then use file system using j2me.if u want any help regarding accessing file system then tell me i will help u lot because i has done many work on it
-kartik |
| honest_success |
| View Public Profile |
| Find all posts by honest_success |
|
thanks for reply
there is no res folder on my project im using netbeans all folders i have is src and dist and build and nbproject where to put the file i tr t put in src but nothing happened |
|
if you create a res folder inside your src folder then open the file as follows:
Player player = Manager.createPlayer(getClass().getResourceAsStream("/res/myfile.wav"),"audio/x-wav"); player.start(); Does this work for you? |
|
thanks for reply
i try this method the code compiled successfully but when test on the emulator it fails nothing played and when hover over player.start it says unknown type player.start i don't know where is the error ?! |
|
Hi
You Have To Put Wave File In The Path Below: "YourProjectPath/PackageName/SRC/test.wav" When You are Setting Address You Have To Set Wave File Path as Like as Below: [Notice]:Address String is Character Sensitive ('A' != 'a' ); createPlayer("/PackageName/SRC/test.wav"); Be sure the wave file simple rate is lower than 48khz. |
| ashematian |
| View Public Profile |
| Find all posts by ashematian |
|
FileConnection file = (FileConnection)Connector.open("file:///root1/recording.wav", Connector.READ);
InputStream input = file.openInputStream(); Player p = Manager.createPlayer(input,"audio/x-wav"); use this code for getting data as input stream.but i don't know where to put wav file in ur example. you should follow some example for this. Rajesh Bansal Software Developer TSSL Delhi |
| RajeshBansal |
| View Public Profile |
| Find all posts by RajeshBansal |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Recording in Amr Format | losym | Symbian Media (Graphics & Sounds) | 12 | 2009-03-26 07:41 |
| File reading & writing help, wav file redaing help | shubhamlahoti | Mobile Java General | 6 | 2007-06-27 10:07 |
| Cannot play avi file in Nokia 9300i with Realplayer. Please help!! | Yatin72 | Streaming and Video | 3 | 2006-12-04 21:10 |
| Play WAV during call not to loud speaker | Bill_Murray | General Symbian C++ | 2 | 2006-01-26 00:44 |
| Nokia Image Converter | davidpurdie | General Discussion | 0 | 2004-02-18 16:31 |