You Are Here:

Community: Developer Discussion Boards

#1 Old where to put the wav file to play it - 2007-09-08, 17:35

Join Date: Sep 2007
Posts: 13
macnux
Offline
Registered User
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();
            }
i try to add it to jar but nothing also i try to put in the directory of the project nothing !!

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.
Reply With Quote

#2 Old your answer - 2007-09-10, 20:41

Join Date: Sep 2007
Posts: 874
honest_success's Avatar
honest_success
Offline
Forum Nokia Champion
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
Reply With Quote

#3 Old Re: where to put the wav file to play it - 2007-09-10, 22:21

Join Date: Sep 2007
Posts: 13
macnux
Offline
Registered User
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
Reply With Quote

#4 Old Re: where to put the wav file to play it - 2007-09-13, 01:07

Join Date: Aug 2007
Posts: 14
ronanocie
Offline
Registered User
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?
Reply With Quote

#5 Old Re: where to put the wav file to play it - 2007-09-16, 14:27

Join Date: Sep 2007
Posts: 13
macnux
Offline
Registered User
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 ?!
Reply With Quote

#6 Old Re: where to put the wav file to play it - 2007-09-18, 08:00

Join Date: Sep 2007
Posts: 1
ashematian
Offline
Registered User
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.
Reply With Quote

#7 Old Red face Re: where to put the wav file to play it - 2007-09-26, 13:33

Join Date: Dec 2006
Posts: 6
Location: India
Send a message via Yahoo to RajeshBansal
RajeshBansal's Avatar
RajeshBansal
Offline
Registered User
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
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
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

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d134434X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ