Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor kfke's Avatar
    Join Date
    May 2008
    Location
    Egypt Giza
    Posts
    52
    Dear all;

    need to play Wave Buffer as (byte[]);

    I'm read it buffer and do some calculation after that need to play it?
    how ?


    byte []data ;
    // cannot convert from byte [] to DataSource
    DataSource ds =new DataSource(data);

    Player player = Manager.createPlayer(ds);
    Eng Kfke
    Egypt Giza
    engkfke@gmail.com

  2. #2
    Super Contributor grahamhughes's Avatar
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,394
    You cannot create a DataSource, because DataSource is abstract. You'd have to write your own subclass.

    The easiest way to create a Player from a byte[] is:

    Code:
    byte[] data;
    
    ByteArrayInputStream bin = new ByteArrayInputStream(data);
    Player p = Manager.createPlayer(bin, MIME_TYPE);
    The byte[] must contain data in a format supported by the device, and the matches the supplied MIME type.

    Graham.

Similar Threads

  1. CMdaAudioOutputStream unexpected playback pauses on Nokia E51
    By pkolaczk in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2009-07-29, 15:13
  2. double buffer for stream and play audio in J2ME
    By cibenxs in forum Mobile Java General
    Replies: 0
    Last Post: 2008-06-12, 11:22
  3. CMdaAudioOutputStream Not working with EXEDLL target
    By fnagaton in forum Symbian C++
    Replies: 6
    Last Post: 2005-10-03, 05:51
  4. Dialog's clipping area (again). Nokia experts, please help
    By synov in forum Symbian User Interface
    Replies: 0
    Last Post: 2004-06-26, 14:35
  5. why can not play wave from buffer?
    By dragonxu in forum Symbian C++
    Replies: 2
    Last Post: 2003-08-29, 02:24

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved