×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    10

    How to create a WAV file

    Hey, I'm working on a project and i need to send a ByteArrayOutputStream to a computer and then create a file from this data. I have already succeeded in sending the data but for some reason the file that i am creating is much more slower than the file i have recorder. In addition the file is cutted in the middle. Can anyone help me?

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: How to create a WAV file

    Hi SalemH,

    you should try posting the code you're using to record and send/receive your data, so that it'll be possible to spot out possible issues with it.

    Pit

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    10

    Re: How to create a WAV file

    The code on the phone

    Code:
    Player playbackPlayer;
    playbackPlayer = Manager.createPlayer(new ByteArrayInputStream(bbb),fff);
    playbackPlayer.start();\\this code starts the player and it works properly
    
    int i;
    	for(i=0;i<bbb.length/1000;i++)
    	{
    		os.write(bbb,i*1000,1000);
    		os.flush();
    		ff.append((i*1000)+"  "+(i*1000+999)+" \n ");
    	}
    	os.write(bbb,i*1000,bbb.length%1000);
    	os.flush();
    the code on the server

    Code:
    is=new DataInputStream(s.getInputStream());
    os=new PrintStream(s.getOutputStream());
    fff=new File("Testing.wav");
    out = new FileOutputStream("Testing.wav");
    byte bbb[]=new byte[1000];
    		try{
    		for(long i=0;i<num/1000;i++)
    			{
    		        is.read(bbb,0,1000);
    			out.write(bbb);
    			out.flush();					
    			}
    		int help=(int)(num%1000);
    		bbb=new byte[help];
    		is.read(bbb);
    		out.write(bbb);
    		out.flush();
    		}catch(IOException e){System.out.println(e);}
    	out.write(-1);
    	out.flush();
    	out.close();

Similar Threads

  1. problem when importing from carbide c++ to vs 2003!
    By misfit.physics in forum Symbian Tools & SDKs
    Replies: 12
    Last Post: 2008-02-19, 09:45
  2. How can I play the segment of an audio file, e.g. wav. file in my N73?
    By ipxx in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2007-07-30, 05:03
  3. Can't create settings file and log file.
    By skhimsara in forum Symbian
    Replies: 1
    Last Post: 2006-05-08, 09:25
  4. Sound from wav file
    By f_alonso_1 in forum Mobile Java General
    Replies: 0
    Last Post: 2003-10-01, 11:07
  5. nokia 7210 modem via IR doesn't work !
    By oussamaaiadi in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2003-03-06, 10:46

Posting Permissions

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