Convert mp3 to byte[],isThere api regard byte[] as param ret Player in jmf

I convert .mp3 to byte[], is there any api regards byte[] as param return Player in jmf ;
it's very important to me!!!!!!!!!!!!!!!!!!!!!!!

It's very important to me that you clearly explain what you want to do.

Similar Messages

  • I convert .mp3 to byte[];how can I use this byte[] to play sound

    thanks

    You can use the JMF (Java Media F-something) to play mp3 files, but I'm not sure if they allow you to play it directly from a byte[]. If the byte[] is in mp3 format, you would need to decompress the soundstream and then use javax.sound.* package to play it. I don't know if JMF allows you to just decompress the mp3, or if it's limited to just playing a file, better have a look there.

  • Converting Japanese two Byte Character...

    Hi,
    I am doing a Scenario outbound from R/3.
    I am triggering the message via proxy using japanese language and sending to XI.
    In XI, we are getting the Mapping Error.
    Some records in the message contains single byte characters and some records having double byte characters.
    For single byte characters, XI is able to generate the target structure in the Mapping. But it is not able to convert the double byte characters to the target structure.
    Can any one help me to resolve this issue....
    Thanks in advance...
    Regards,
    Vasu

    Hi,
    Japanese data are Shift JIS encoded ? Maybe changing the encoding (or encoding declaration) could help ?
    Chris

  • I save .mp3 to byte[];now how can I play it?

    thanks

    I say it more clearly:
    I save .mp3 to byte[];
    what api in java can use the byte[] to play sound

  • Converting Files to bytes

    hello
    Just want to know if there anyway to convert a text file to bytes. I can read the textfile but i want to convert them to bytes and store them.

    http://java.sun.com/j2se/1.4.1/docs/api/java/io/InputStream.html
    http://java.sun.com/j2se/1.4.1/docs/api/java/io/OutputStream.html
    Note that the Input[Output]Streams conserve extra byte information other than the content of a text.

  • Converting String to byte array

    Hi,
    There is a code for converting String to byte array, as follows:
         public byte[] toByteArray(String s)
              char[] c = s.toCharArray();
              int len = c.length;
              byte[] b = new byte[len * 2];
    for ( int i = 0 ; i < len ; i++ )
         b[i * 2] = (byte)(c);
         b[(i * 2) + 1] = (byte)(c[i] >> 8);
    return b;
    But this isn't doing the conversion properly. For example, for the � (euro) symbol, it converts to some other unreadable symbol. Also, same is the case for square brackets. Any idea why this' so? What's wrong with the above code?
    The encoding format is UTF-8.
    Thanks.

    > In fact, I tried with String.getBytes() too, but leads to the same problem, with those specific symbols.
    Did you try the String.getBytes(String charsetName) method?
    Both methods have been around since Java 1.1.
    It's an extremely important skill to learn to read the API and become familiar with the tools you will use to program Java. Java has an extensive set of online documentation that you can even download for your convenience. These "javadocs" are indexed and categorized so you can quickly look up any class or method. Take the time to consult this resource whenever you have a question - you'll find they typically contain very detailed descriptions and possibly some code examples.
    Java� API Specifications
    Java� 1.5 JDK Javadocs
    Best of luck!
    ~

  • How can i convert object to byte array very*100 fast?

    i need to transfer a object by datagram packet in embeded system.
    i make a code fallowing sequence.
    1) convert object to byte array ( i append object attribute to byte[] sequencailly )
    2) send the byte array by datagram packet ( by JNI )
    but, it's not satisfied my requirement.
    it must be finished in 1ms.
    but, converting is spending 2ms.
    network speed is not bottleneck. ( transfer time is 0.3ms and packet size is 4096 bytes )
    Using ObjectOutputStream is very slow, so i'm using this way.
    is there antoher way? or how can i improve?
    Edited by: JongpilKim on May 17, 2009 10:48 PM
    Edited by: JongpilKim on May 17, 2009 10:51 PM
    Edited by: JongpilKim on May 17, 2009 10:53 PM

    thanks a lot for your reply.
    now, i use udp socket for communication, but, i must use hardware pci communication later.
    so, i wrap the communication logic to use jni.
    for convert a object to byte array,
    i used ObjectInputStream before, but it was so slow.
    so, i change the implementation to use byte array directly, like ByteBuffer.
    ex)
    public class ByteArrayHelper {
    private byte[] buf = new byte[1024];
    int idx = 0;
    public void putInt(int val){
    buf[idx++] = (byte)(val & 0xff);
    buf[idx++] = (byte)((val>>8) & 0xff);
    buf[idx++] = (byte)((val>>16) & 0xff);
    buf[idx++] = (byte)((val>>24) & 0xff);
    public void putDouble(double val){ .... }
    public void putFloat(float val){ ... }
    public byte[] toByteArray(){ return this.buf; }
    public class PacketData {
    priavte int a;
    private int b;
    public byte[] getByteArray(){
    ByteArrayHelper helper = new ByteArrayHelper();
    helper.putInt(a);
    helper.putInt(b);
    return helper.toByteArray();
    but, it's not enough.
    is there another way to send a object data?
    in java language, i can't access memory directly.
    in c language, if i use struct, i can send struct data to copy memory by socket and it's very fast.
    Edited by: JongpilKim on May 18, 2009 5:26 PM

  • How do I convert a double-byte encoded file to single-byte ASCII?

    Hello,
    I am working with XML files (apparently coded in UTF-8) which encoded in double-byte characters.
    The problem is the characters for end of line: 00 0D 00 0A
    This double byte end of line is causing a problem with a legacy conversion tool (which deals with 0D 0A). The file itself contains no
    accented/international characters, so in principle converting to single-byte should not cause any problems.
    I have tried to convert this file with tools like native2ascii and the conversion tools that are part of Notepad++ but without
    any luck - the "00 0D 00 0A" are still present in the output
    Can anyone point me to a tool or some code that can convet this file into single-byte?
    Thank you.

    Amiens wrote:
    native2ascii.exe -encoding UTF-16 -reverse INPUT.xml OUTPUT.xml
    gives 00 00 0 0D 00 00 00 0A
    so clearly that is not the required output.What you've got there is UTF-16 encoded text that's been converted to UTF-16. Get rid of the "-reverse" option and you should see the result you expect.

  • How can I convert stream to byte and byte to stream

    I got a IInputStream from BackgroundDownloader operation, how can I convert it to byte array? I try to convert it to buffer and after that to bytes, but it's always throw exception.
    function decryptStream(inputStream, totalBytes) {
    var reader = new Windows.Storage.Streams.DataReader(inputStream);
    var iBuffer = reader.readBuffer(totalBytes);
    var bytes = Windows.Security.Cryptography.CryptographicBuffer.copyToByteArray(iBuffer);
    Could I have examples about that?

    Hi Jeft,
    In my program, I have a BackgroundDownloader to download an image. When we have result, I will convert it to bytes array.
    if (p.hasResponseChanged && imageStream == null) {
    imageStream = operation.getResultStreamAt(0);
    if (!p.hasResponseChanged && imageStream != null) {
    decryptStream(imageStream, p['bytesReceived']);

  • Converting mp3 to aiff

    How do I convert mp3 files to AIFF? My mp3 audio files in Final Cut Pro have these nasty drop-out/pops. I heard from another forum that the ticket is to convert my mp3s to AIFF - so, once again - How?
    thanks in advance.

    "Best" depends totally on your usage, so without knowing what you need these files for and what your criteria will be, it's difficult to offer any useful advice.
    "CAF" is probably "Core Audio Format". See this developer article for information.
    Regards.

  • Need to convert MP3 in URL to play it in myspace

    Hello
    Help ! I need to convert MP3 into URL? (I have a flashfetish player on Myspace they only read url for a dj mix)
    which sites or witch converter?
    Hope to speak soon !

    there is no such thing as "converting an mp3 to a URL." a URL is a pointer to where the file resides online. iow, you have to "upload" the mp3 somewhere (typically a web site that you own), and then use that URL to point to the file.
    for example this:
    http://www.bulletsandbones.com/BBPages/History/BBMp3s/01Real%20World.mp3
    points to a file located on the bulletsandbones web site

  • Python / Audio Conversion - I want to convert mp3 to wav

    Hi, Ive dabbled very little in actual coding, wrote one python app that these forums really helped me make, and Ive programmed in VBScript and SQL Server, but all academic, nothing for my own uses.  I need a program to convert mp3's to .wav's that can then be burned in 'Recorder' to burn the audio disc.  I know there are many scripts like this floating around, but I want to do my own, problem is, im lost.  I seem to have 2 main problems, getting the file names into a list or tuple,  and then actually running the commands to convert using a for loop using lame or mpg321.
    this bash script uses mpg321 and sox,
    #!/bin/bash
    # allmp3wav
    for i in *.mp3; do
    echo "$i"
    tgt=$(echo "$i" | sed -e "s/mp3/wav/")
    mpg123 -b 10000 -s -r 44100 "$i" | sox -t raw -r 44100 -s -w -c2 - /var/cdrom/"$tgt"
    done
    This works fine and I understand the code.  Its saying for every file that ends in .mp3, run these commands, which do the coding.  The only problem is, this doesnt work in python, since its not pythong   Can someone give me a little bit of help?  Dont give me the program, or give me to much info, links would be great.
    1 - Need to Get Directory
    2 - Loop through all the .mp3 files and add them to an array.
    3 - create a sub directory named "wav"
    mkdir ~/wav
    4 - copy all the mp3's to "wav"
    cp ARRAy to wav/
    5 - convert all .mp3's to wav
    6 - delete the copied mp3's from .wav directory
    for .mp3
    rm
    7 - tell me how many wavs were created.
    for .wav
    count + 1
    That is just a rough flow chart of what I need to do, and as you can see its pretty bare as of now.  Also, I imagine to run mpg321 or lame commands, I need some sort of lame or mpg321 module?  Ive read the python wiki for for loops and lists and tuples, but I need more info.  Thanks, Justin.

    Alright that helped alot, its almost working now, I am using Popen wrong still I assume, here is what I got.
    import os
    import subprocess
    here = os.getcwd()
    ctr = 0
    for file in os.listdir(here):
        name, ext = os.path.splitext(file)
        if ext == ".mp3":
                    p = subprocess.Popen("mpg123 -w " + name + ".wav " + name + ext , stdout=subprocess.PIPE, shell=True)
                    ctr = ctr + 1
    print ctr
    That executes, but gives this error,
    High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
    version 1.4.3; written and copyright by Michael Hipp and others
    free software (LGPL/GPL) without any warranty but with best wishes
    [readers.c:893] error: Cannot file [Beginning: No such file or directory
    [mpg123.c:516] error: Cannot open [Beginning: File access error. (code 22)
    [readers.c:893] error: Cannot file of: No such file or directory
    [mpg123.c:516] error: Cannot open of: File access error. (code 22)
    [readers.c:893] error: Cannot file Whats About to Happen] HWY 74.wav 01 [Beginni
    ng of Whats: No such file or directory
    [mpg123.c:516] error: Cannot open Whats About to Happen] HWY 74.wav 01 [Beginnin
    g of Whats: File access error. (code 22)
    [readers.c:893] error: Cannot file About: No such file or directory
    [mpg123.c:516] error: Cannot open About: File access error. (code 22)
    [readers.c:893] error: Cannot file to: No such file or directory
    [mpg123.c:516] error: Cannot open to: File access error. (code 22)
    [readers.c:893] error: Cannot file Happen]: No such file or directory
    [mpg123.c:516] error: Cannot open Happen]: File access error. (code 22)
    [readers.c:893] error: Cannot file HWY: No such file or directory
    [mpg123.c:516] error: Cannot open HWY: File access error. (code 22)
    [readers.c:893] error: Cannot file 74.mp3: No such file or directory
    [mpg123.c:516] error: Cannot open 74.mp3: File access error. (code 22)
    2
    If i remove the subprocess popen, and just print name + ext and use the counter, it prints out both file name together, and how many mp3's it processed, 2.  So i know the program is doing what I want, im just converting wrong.  Thanks again.
    here is whats in the directory, there is more then mp3's, so I know it is filtering the files properly thanks to your splittext.
    justin ~/build/convert $  dir -ls
    total 12104
      20 -rw-r--r-- 1 justin justin   17138 2008-05-19 17:59 00\ -\ Wretch.txt
       4 -rw-r--r-- 1 justin justin      44 2008-06-01 18:20 01
    7588 -rw-r--r-- 1 justin justin 7768364 2008-05-19 17:59 01\ [Beginning\ of\ What's\ About\ to\ Happen]\ HWY\ 74.mp3
       4 -rw-r--r-- 1 justin justin      44 2008-06-01 18:20 02
    4484 -rw-r--r-- 1 justin justin 4588063 2008-05-19 17:59 02\ Love\ Has\ Passed\ Me\ By.mp3
       4 -rw-r--r-- 1 justin justin    1284 2008-06-01 18:20 convert.py
    justin ~/build/convert $
    Last edited by axion419 (2008-06-01 22:23:32)

  • Why does Logic Convert MP3 to Aif and store them on Desktop?

    Gentlemen please bear with me on this probably elementary question here - (you are dealing with someone who until recently refused to stop using Logic 6 on an old but very stable G4 tower OS 9 because it worked so perfectly and still does)...
    I have found that when importing audio files( ie CD tracks or MP3s) from an external hard drive into the audio window (via Control F) , there is some sort of preference which does not simple use the original file but copies it to my desktop into a new fold called "Audio".
    In the actual song document, looking at the song path and recording path etc, everything points to my faithful La Cie external hard drive. There is obviously some extra step or song managing process included in Logic 7 which does this and which I have yet to figure out...
    Could this be something to do with the Project Manager preferences ( I never use this feature except for Save as Project when backing up a song at the end of the process when it is done and dusted)
    Any explanations gratefullly accepted
    Powerbook 5,8   Mac OS X (10.4.8)   G4 Powerbook

    I'm not sure I can help. Compressed audio files must be converted to work in Logic version prior to 7.2. Otherwise, audio files should remain in their original locations unless you've specified in you project settings to copy external files into your project folder. It gets messy working on a seesion for which there is no project folder created, in my opinion. You might just want to save your new sessions as projects, but don't check the "copy external audio..." box until you're ready to archive. That way, at least your converted mp3s will land in a tidy location.
    I partly responded to give this post a bump, becuse I'm not sure I have the answer.

  • Convert mp3 to 5.1 surround sound?

    i have a xfi and im attempting to convert a mp3 to 5.1 surround sound. When i got to do it, it says failure file conversion not supported. Am i doing something wrong or can it not be done? it only lets me convert mp3s to 2 channel.

    http://forums.creative.com/creativelabs/board/message?board.id=soundblaster&message.id=2563
    For to get mp3 saved as multichannel audio, you need to record while playing the mp3 file using Creative Media Source (play mp3 file w/ another software, on Media Source set the recording format to "WAV multichannel" and recording source to "What U Hear". You also need to set the CMSS 3D by the instructions behind the above link).
    jutapa

  • How to convert mp3 software instrument samples to format garageband can use

    Hi and thanks in advance.
    I'm using GB '08 on OSX 10.4.11 w/ a G4 MDD. ( Sorry folks,  This is the setup that I have and cannot buy a new computer or software at this time)
    I'm pretty new too DAW and all of this but want to compose music with traditional orchestra sounds as well as what GB offers.
    I have found Muse Score and I can get some pretty good results for writing but I want to expand the software instrument voices that GB has.
    I found  http://www.philharmonia.co.uk/thesoundexchange/make_music/samples/library/
    and they have some pretty good sounding software instruments for free, except that they are in mp3 format.
    I did some reading and see that GB understands a different format for this. I put some of the sounds into the correct GB folder as a test and result is of course no go. I see that GB uses exs and cst files in addition to wav and aff files.
    How do I convert mp3 software instrument samples to the formats garageband can use? Is there a way? What would I need to do this?
    Thanks again..

    The first step would probably be to convert the samples into AIFF files, that's what GB's sample files are in.
    But so far that's only a collection of samples - what you need is a sampler file that tells the software which sample to trigger with which key (the .exs files in GB's instrument library).
    Since your software is old, t works pretty well with soundfonts (the latest versions have problems), so you might try this software to create them:
    http://sonicamigos.com/polyphontics/
    All about soundfonts:
    http://www.bulletsandbones.com/GB/Tutorials/SoundFonts.html
    P.S.: The softare costs $60, but you can create 10 instruments for free.

Maybe you are looking for

  • Help with filling a if statement

    hello everyone i hope someone can help me if you look at my code below the arraylist contains the number 8. but i want to know how i can use that number 8 inside the if statement (if (i%10 == 1)) where the number 1 is, so that number 1 will change to

  • Printing problem Intel-based Imac

    I've tried printing to my HP 895Cxi with little luck. After following tips (uninstall gimp, reset printers, etc.) found in this forum, I can get parts of some documents to print ok, while other parts (esp in mail) such as headers have letters that cu

  • SOS: module /TMWFLOW/CHECK_PRJ_CONS: No export system for productive client

    HI, gurus: when activating Change request manager in project, i met an error: Message from function module /TMWFLOW/CHECK_PRJ_CONS: No export system for PRD-100 (PRD is productive system) hwo to fix it? hi, the problem has been fix, it is due to a in

  • Tcp ip remote control without computer

    Hii, i would like to get data from a device over TCP/IP, or send data but i dont want to use Pc near that device, is there any product or device, that i can connect it from my pc over TCP/IP and get datas. Thanks a lot

  • BW Emails

    Can emails be sent from BW informing users of report availability?  What are capabilities?  Where can I find more information on this topic?