Question of javaSoundApi for mp3 player (from China,anyone can help me)

I am so sorry about my English is poor,I can not description clearly.
I wrote a player with javaSoundApi, only can play, I want to add a quick retreat quickly into the control, and how am I going to do?
My main code below, I hope you can understand
ais=AudioSystem.getAudioInputStream(f); //ais is the AudioInputStream
     af=ais.getFormat(); //af is the AudioFormat
     //加入这个音频格式不是PCM,则要转换
     if(!af.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED)){
     AudioFormat audioformat=new AudioFormat(AudioFormat.Encoding.PCM_SIGNED,af.getSampleRate(),
                    16,af.getChannels(),af.getChannels()*2,af.getSampleRate(),false);
          AudioInputStream audioinputstream=AudioSystem.getAudioInputStream(audioformat, ais);
          //转换
          ais=audioinputstream;
          af=audioformat;
// if get the audioformat then read and write********
int len=(int)af.getSampleRate()*af.getFrameSize();
          byte[] buffer=new byte[len]; //每秒样本数乘以每秒帧大小
          int buffer_all=0; //读入缓冲区总字节数,返回-1时结束
          sdl.open(af, sdl.getBufferSize());
          sdl.start();
          while(buffer_all>=0){
               buffer_all=ais.read(buffer,0,len);
if i want to add fast Forward and Rewind , how to change these code
It is reading second by second and then display .would you have any other ways ?
Please write the code to me,I do not want to translate,and as simple as possible.Thank you!
               if(buffer_all>=0){
                    sdl.write(buffer, 0, buffer_all);
Edited by: ToKy_Kero on Oct 19, 2009 10:09 PM

HI any one can help me in................................If you have question about Java, yes. If you want people to do your homework, no.

Similar Messages

  • After Upgrade of Iphone 4 to IOS7 i cannot restore from backup Anyone can help?

    Have backuped up my iPhone 4 and then upgrade to IOS7.
    Unfortunately have lost all the information since itunes is failing when trying to restore backup.
    Anyone can help?

    http://support.apple.com/kb/ts2529

  • Change .MP3 Player From QT to WMP

    Hi,
    I would like to change my .MP3 player from default QuickTime to Windows Media Player but don't know how.
    Thanks.
    John

    Ah, okay.
    Here's a neater version of what I just posted before. I forgot I had it in a file.
    [Mac OS X: Double-Clicking a File Opens the Wrong Application|http://support.apple.com/kb/TS2291?viewlocale=en_US]
    *Changing the application used to open all files of a certain kind*
    1) In a Finder window highlight a file of the kind you want to change the application to open that kind of file.
    2) While that file is highlighted, select File > Get Info or press command (apple or propeller icon) + i to get a file information window.
    3) In the lower part of the info window there is an "open with" menu with a list of applications.
    4) If your application is already in the box then it is the default application for opening that kind of file and you don't need to do anything more. Close the get info window.
    5) If the application showing in the menu is not the one with which you wish to open the file then select a new application. If your application does not appear there then select the "other..." and track down the application (usually in the Applications folder at the main level of the computer).
    6) If you wish to change all files of this type to open with this application in future, make sure the "change all" button is selected.
    7) Close the get info window.

  • HT201269 how do u transfer songs to a mp3 player from itunes?

    how do I transfer songs to a mp3 player from itunes?

    Purple68 wrote:
    I just purchase songs from ITunes...
    You made a mistake already.  If you want MP3s, it is better to avoid the iTunes Store altogether, and buy songs in MP3 format (e.g. from Amazon Digital Music or other source).
    But all is not lost.  First check whether your MP3 player can play songs in AAC format.  If yes, continue to next step.  If not, convert your Purchased AAC files to MP3 per this guide:
    iTunes: How to convert a song to a different file format
    http://support.apple.com/kb/HT1550
    Once you have them in the right format, add them to the MP3 player.  iTunes is not capable of automatically syncing a non-Apple device.  However, for most players you can connect via USB, highlight the tracks you want from iTunes, and drag them into the player.

  • MP3 Player Auto Starts, How can I get it to load, but not Auto Start

    MP3 Player Auto Starts, How can I get it to load, but not
    Auto Start
    Jeff
    http://www.point1music.com/test

    How do you code it not to stream?
    stopAllSounds();
    stop();
    playlist = new XML();
    playlist.ignoreWhite = true;
    playlist.onLoad = function(success) {
    if (success) {
    _global.songname = [];
    _global.songband = [];
    _global.songfile = [];
    for (var i = 0; i<playlist.firstChild.childNodes.length;
    i++) {
    _global.songname
    = playlist.firstChild.childNodes.attributes.name;
    _global.songfile
    = playlist.firstChild.childNodes.attributes.file;
    trace(songname
    +" "+songfile);
    _root.createEmptyMovieClip("sound_mc", 1);
    _root.sound_mc.sound_obj = new Sound();
    _global.song_nr = random(songfile.length);
    _root.sound_mc.songStarter(songfile[song_nr],
    songname[song_nr]);
    MovieClip.prototype.songStarter = function(file, name) {
    this.sound_obj.loadSound(file, true);
    this.onEnterFrame = function() {
    if (this.sound_obj.position>0) {
    delete this.onEnterFrame;
    this._parent.display_txt.text = name;
    } else {
    this._parent.display_txt.text = "loading...";
    this.sound_obj.onSoundComplete = function() {
    (song_nr == songfiles.length-1) ? _global.song_nr=0 :
    _global.song_nr++;
    _root.sound_mc.songStarter(songfiles[song_nr],
    songname[song_nr]);
    btn_play.onRelease = function() {
    this._parent.sound_mc.songStarter(songfile[song_nr],
    songname[song_nr]);
    btn_stop.onRelease = function() {
    this._parent.sound_mc.sound_obj.stop();
    btn_fw.onRelease = function() {
    (song_nr == songfile.length-1) ? _global.song_nr=0 :
    _global.song_nr++;
    _root.sound_mc.songStarter(songfile[song_nr],
    songname[song_nr]);
    btn_rev.onRelease = function() {
    (song_nr == 0) ? _global.song_nr=songfile.length-1 :
    _global.song_nr--;
    _root.sound_mc.songStarter(songfile[song_nr],
    songname[song_nr]);
    playlist.load("playlist.xml");

  • Hi I live in Sweden and want to buy an iPad air 64g wifi from us because it's much cheaper but I can't put in my address to Sweden it's only for us is it something you can help me with

    Hi I live in Sweden and want to buy an iPad air 64g wifi from us because it's much cheaper but I can't put in my address to Sweden it's only for us is it something you can help me with

    Apple in the US will not ship from the US to any other country.

  • I Baught A iMac 2010 From Someone it came with lion but for the programs i use i need snow leopard but when trying to install it won't boot from usb or cd what can be the problem i've been at this for over 24 hours if anyone ca help it'd be greatly apprec

    I Baught A iMac 2010 From Someone it came with lion but for the programs i use i need snow leopard but when trying to install it won't boot from usb or cd what can be the problem i've been at this for over 24 hours if anyone ca help it'd be greatly appreciate it! Thanks!

    Downgrade OS X Lion To Snow Leopard [Video How-To]
    http://www.cultofmac.com/110614/downgrade-os-x-lion-to-snow-leopard-video-how-to /
    How To Downgrade OS X Lion To Snow Leopard: The Complete Tutorial
    http://www.redmondpie.com/how-to-downgrade-os-x-lion-to-snow-leopard-the-complet e-tutorial/
    How To Downgrade from Apple OS X Lion to Snow Leopard
    http://www.pcmag.com/article2/0,2817,2389334,00.asp

  • MP3 player is not an iPod- help needed

    I've got an iTunes gift card and would just like to get a few tunes and use my existing setup. I like Windows Media Player and I have a Sansa mp3 player. I can't play my iTunes music with Windows Media Player and I can't sync my mp3 player with iTunes. Can anyone provide help?

    You can't use iTunes purchases on anything other than an iPod or an iTunes compatible phone or convert them to another format because of the DRM (Digital Rights Management) copy protection. However if you burn it to an audio CD you can import it back as MP3. You'll be able to use this version of the track on other devices or software.

  • I have a little bit problem with verify my apple ID, I don't get any message for verification aplle ID from Apple. Why? Anyone can help me

    Dear all,
    I have a little bit problem with verify my apple ID, I don't get any message for verification aplle ID from Apple. Why? Anyone can help me

    Hi Tep Virak,
    Thanks for visiting Apple Support Communities.
    You may want to log into your Apple ID first to double-check that it's the right email address and re-send the verification email using these steps:
    Sign in to My Apple ID to manage your account information.
    Click Resend under Primary Email Address.
    From:
    Apple ID: Associating and verifying email addresses with your Apple ID
    http://support.apple.com/kb/he68
    All the best,
    Jeremy

  • I am using iPad 3 and I try to use 30-pin Digital AV adaptor for mirroring on my Samsung HD TV.  Unfortunately it is not a full screen projection.  Anyone can help?

    I am using iPad 3 and I try to use 30-pin Digital AV adaptor for mirroring on my Samsung HD TV.  Unfortunately it is not a full screen projection.  Anyone can help?

    The iPad Screen is almost square, HD TVs are rectangular so will never be full screen.  When watching movies, the movies native aspect ratio will be used rather than the iPads screen aspect ratio so will look full screen if the movie is full screen, but most likely will be seen in wide screen letter box format. with black bars across the top and bottom as that what most movies from iTunes are in, format wise

  • I can not save any data to external hard drive from my mac pro. Is there anyone can help me in this regard?( note, when i first plug my ext. drive to mac i chose option to backup later)

    I can not save any data to external hard drive from my mac pro. Is there anyone can help me in this regard?( note, when i first plug my ext. drive to mac i chose option to backup later)

    The device may be formatted for Windows, as NTFS. The format is readable, but not natively writable on a Mac. To write to the device, you must either reformat it (erasing all the contents) or install third-party software to enable write access to NTFS.

  • HT3775 hello guys, i m just wondering that which software would be the best for my macbook pro. whenever i try to open those video, it says '(video name)avi' cant open. that will be appreciable if anyone can help me out. thanks.

    hello guys, i m just wondering that which software would be the best for my macbook pro. whenever i try to open those video, it says '(video name)avi' cant open. that will be appreciable if anyone can help me out. thanks.

    I think that VLC Media Player will play avi files.
    Regards,
    Clinton

  • I need to upgrade to mac os snow leopard from 10.5.8, and have the lion OS usb. I can't upgrade to snow leopard as my father doesn't remember the admin password.  If anyone can help it would be appreciatedeas

    I need to upgrade to mac os snow leopard from 10.5.8, and have the lion OS usb. I can't upgrade to snow leopard as my father doesn't remember the admin password.  If anyone can help it would be appreciated

    Restart with the Mac OS X 10.6 DVD in the drive or with the Lion USB drive connected, hold down the Option key just after the restart, tab to the installation disk, and press Enter. If the computer has a firmware password set, it needs to be provided for this to work.
    (66822)

  • Hi, i'm paying every mont for photoshop and lightroom, I had to bring my Mac to apple to change the hard drive, and now i want reinstall my programs, anyone can help me?

    Hi, i'm paying every mont for photoshop and lightroom, I had to bring my Mac to apple to change the hard drive, and now i want reinstall my programs, anyone can help me?

    Download and install the trial version(s) from https://www.adobe.com/creativecloud/catalog/desktop.html and activate them with your Adobe ID.

  • My ipad 2 camera stop functioning when i switch from back to front? Anyone can help me? i have already restore my ipad2 but the problem is still recurring.

    My ipad 2 camera stop functioning when i switch from back to front? Anyone can help me? i have already restore my ipad2 but the problem is still recurring.

    Abelynn-
    Does the problem occur in both Camera and Photo Booth Apps?  If you run the FaceTime App, does the front camera work?
    If the front camera never works, you may have a defective iPad.  If you are near an Apple company store, the Apple Store Genius can verify the problem, and may replace it on the spot.
    If the front camera works for at least one App, try rebooting the iPad.  Hold down both the Home and Sleep buttons for several seconds until the Apple logo appears.  Ignore the "Slide to power off" arrow.  After a couple of minutes, the iPad will restart.  Rebooting will not hurt anything, and may correct your problem.
    Fred

Maybe you are looking for

  • Canon MP280 quit printing

    I'll start by thanking the guy who set up the registration process for informing me that my first name is a "bad word" and that I must "clean up my language" before proceeding.  I'll rush down to the courthouse tomorrow to change the name that I've c

  • Why do we need to need Desktop Experience to get Disk Cleanup?

    Why do we need to need Desktop Experience to get Disk Cleanup? What other options do we have?

  • Program for multiple workspaces?

    Hey, i'm looking for a program that lets me have multiple workspaces (like in linux). I use my mac to reduce astronomy data which requires a bunch of windows, and it'd be more convenient to be able to have an entire workspace for that. Any recommenda

  • Blinking Windows on the Desktop

    Computer Dell Vostro 1510 with 2 GB RAM Operating System: Windows XP with all service packs and updates Recently I installed/updated Firefox to the latest beta version. That went well. The following day, I booted the laptop and windows on the desktop

  • How do you add photos to photo stream from mac?

    Also, I have older photos on my iphones photostream that are not showing up in iphoto on my photostream.