I'm trying to write a simple media playback application in J2ME. Currently I'm starting with the most simple thing, I just want to play a wav file from resources included in the jar file. I'm using this simple code:
DataInputStream wav = new DataInputStream(getClass().getResourceAsStream("sample.wav"));
Player player = Manager.createPlayer(wav, "audio/x-wav");
player.addPlayerListener(this);
player.realize();
VolumeControl vc = (VolumeControl) player.getControl("VolumeControl");
if( vc != null )
vc.setLevel(100);
player.start();
I run it on two phones: Nokia E65 with latest firmware and Nokia 3110c with original firmware. On E65 I see that the player is created, it starts playing and there are no exceptions thrown. But I can hear nothing... The same wav file works fine with built in media player.
As you see I have a player listener attached and it only receives single message: STARTED. (There is no VOLUME_CHANGED or END_OF_MEDIA event.)
The same jar file running on Nokia 3110c plays fine and shows all expected player events.
Any idea what may be wrong with the E65 or what I'm doing wrong?
I've found solution at Nokia forums: Does J2ME Media Player on Nokia E65 work?
Warning Tones must be enabled in user's profile.
Make sure you have "warning sounds" switched on in the current profile...
...check the manual for the device. On the N96, it's in Tools, Profiles, (select profile), Options, Personalise, Warning Tones.
There's no way to check this setting from the j2me application code.
Related
I am new to .Net MAUI and I never used the xamarin. I am trying to create a simple app (focused on android mainly) which records the audio and then plays it for them. So far, only one package has worked for me in this matter i.e. "Plugin.AudioRecorder" (https://github.com/NateRickard/Plugin.AudioRecorder) but, this package is not working with xiaomi devices. It is responding to the button click and navigating to the command but its startRecording function do nothing.
Here is my code.command snippet
I also need the audio transcription but that is a different story.
If I would like to use the local media player of Nokia S40 FT device in my application for mp3 audio. How can I do that?
have you try to use platform Request?
you can find something useful in here http://www.developer.nokia.com/Resources/Library/Java/#!developers-guides/invoking-applications/invoking-applications-in-java-me.html
I wrote this a while back:
http://indiegamemusic.com/help.php?id=1
Should be what you need.
you may use method from com.nokia.mid.impl.jms.core.Launcher:
String url = "E:\\mymp3.mp3";
Launcher.handleContent(url);
But its required manufacturer or operator domain certificate. But you may open full access for filesystem from JAVA-apps (like a Root in android).
I am new for J2me , can some tell me how can we open image located in memory card open in device default player, same for video.
I try for CHAPI, but its not working. Its work only for http urls.
I saw WhatsApp in S40 Device Nokia Asha 303, it is doing same thing what i want, it open read image from its memory card & display it in Default Image Viewer of Device.
Thanks In Advance
You can use platformRequest() to call native stuff, like dialing a phonenumber or opening a webpage. I've never tried opening a local file, but it should work the same way.
http://docs.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/javax/microedition/midlet/MIDlet.html#platformRequest%28java.lang.String%29
So if you do platformRequest("file://path/to/video.mp4"); then the device should figure out that it's a video and then open the default video-viewer.
I have searched for various articles about playing mp3 files in firefox but no luck.
I want something similar to this website for playing my audio files:
http://www.waatea603am.co.nz/podcasts
Can anyone tell me how is the audio files being played in the website. I want to do something similar. I cant figure out how it is being done.
Thanks
Here's the JavaScript that makes the links play sound:
http://www.waatea603am.co.nz/Resources/JavaScript/podcast-audio.js
It's basically using the HTML5 Audio element:
<script type="text/javascript">
var snd = new Audio("file.mp3"); // buffers automatically when created
snd.play();
</script>
http://www.w3.org/wiki/HTML/Elements/audio
This isn't really a "programming" question, as much as a "Firefox configuration" question.
Personally:
I don't really have any preferences of "media player" for Linux
I simply use Windows media player for Windows
Windows Media player comes built in with all recent versions of Windows
Windows media is the default file association for .mp3 on all recent versions of Windows
Consequently, Firefox automatically uses Windows Media player to play .mp3's
Here's more info:
Issues:_Sound">http://kb.mozillazine.org/Mozilla_Suite_:Issues:_Sound
http://support.mozilla.org/en-US/kb/fix-common-audio-and-video-issues
'Hope that helps .. PSM
PS:
Unfortunately, most commercial Internet radio stations seem to use Flash to broadcast audio streams. Sigh...
I want to develop a j2me application that will play a video file(.mp4) by selecting a particular directory on mobile phone(nokia s40 series).
How do i go about this?can anyone help me to initiate the above said process.
You need to use JSR-135 and JSR-75 to accomplish this.
Check http://www.forum.nokia.com/document/Java_Developers_Library_v2/GUID-96C1B6E4-C266-42A9-9581-A6EEDAC44AC4_GUID-B6B3EB3A-05F6-4CD4-920A-8ED818328681.html for Nokia implementation notes for JSR-75 FileConnection.
Check http://www.forum.nokia.com/document/Java_Developers_Library_v2/GUID-96C1B6E4-C266-42A9-9581-A6EEDAC44AC4_GUID-F227753C-29F7-4056-AB46-1BD80F83E109.html for Nokia implementation notes for JSR-135 Mobile Media.
The Javadocs can be found: http://java.sun.com/javame/reference/apis/jsr135/ and http://www.forum.nokia.com/document/Java_Developers_Library_v2/GUID-D69FC49D-783E-45CE-80D4-7A9F3EE08B2A/overview-summary.html .
Note that only certain directories are exposed via Java ME. You can find information on which folders under the System properties link in the JSR-75 link above.
Basically you want to do this:
Use FileConnection to open a directory and list it contents.
Let the user choose one of the files in the directory.
Create a video player via JSR-135 with the file path as input: Player player = Manager.createPlayer("path_to_the_file");
You also have to attach a VideoControl to the player that associoates a canvas/form to render the video on. (Use VideoControl.initDisplayMode). You also set all the video properties via this control, such as size, location etc.
Then use player.start() to start the playback.
This is a pretty good starting tutorial: http://today.java.net/pub/a/today/2005/09/27/j2me4.html