Simple Sound Recording - Help needed

Hi there
Im wondering if this is possible and if so , does anbody know offhand where I can find a basic implementation of this typea thing...
I simply need to be able to read in a wav file, then record it and give it a different name. I am just trying to get this basic functionality sorted, because I will be progressing on to reading in a file, runninig some DSP algorithm on it, and then needing to save it back out, so I elieve that I need to write it in chunks much the same as the SourceDataLine buffers the sound...err am i making sense?
I have been trying to do this with TargetDataLine, and its just getting the better of me at the moment, I am able to read in the file and play it as normal, its just the recording it to an output file where I am failing.
thanks a million
conaill

Do I get you right that you want to read a sound file into memory and then store it back to the hard disk? If this is the case, try this:
int frameSizeInBytes;
int bufferLengthInFrames = 32;
int bufferLengthInBytes;
byte[] data;
int numBytesRead;
BufferedReader mIn;
AudioFormat format;
ByteArrayInputStream bIn;
AudioInputStream outStream;
File o;
int soundLength;
soundLength = 1000;
f = new File("infile.wav");
inStream = AudioSystem.getAudioInputStream(f);
format = inStream.getFormat();
frameSizeInBytes = format.getFrameSize();
bufferLengthInBytes = bufferLengthInFrames * frameSizeInBytes;
data = new byte[soundLength];
o = new File("outfile.wav");
// read the sound data
numBytesRead = inStream.read(data, 0, soundLength);
inStream.close();
// now write it back
bIn = new ByteArrayInputStream(data);
outStream = new AudioInputStream(bIn, format, soundLength);
AudioSystem.write(outStream, AudioFileFormat.Type.WAVE, o);This reads only a portion of a file, you'll have to modifiy it.
Hope this helps,
S

Similar Messages

  • Recording help needed

    recording help needed. I'm a beginner, imac, logic express and helix board 12 firewire.
    I have recorded my daughter voice only ok, BUT when i import audio file to track 1 as backing track and my daughter is using headphones from the helixboard to sing to she does not record to track 2 when all in enabled.
    Should her headphone come from the imac and not the helix board
    Regards
    Paul

    Check the recording channel in the channel strip.
    It must be set the same as the audio interface channel.
    cheers
    rob

  • Simple BIP Report help needed

    Hi All ,
    I am bit new to BI Publisher,I have done plenty of Oracle reports 6i and 10g.
    Have read the BIPublisher Guide as well,but could not understand a few points.
    suppose I want to build a very very simple report like
    Sysdate Sysdate Sysdate
    16-Oct-08 16-Oct-08 16-Oct-08
    step 1) I will write the following query in the Data Model and store/save it.
    select sysdate ,sysdate,sysdate from dual.
    Step 2) In the layout model I want to use .rtf layout .So in the MS word .rdf document I create /insert
    a table with 2 rows and 3 columns,where 1st row will have Sysdate in all 3 columns as header.
    Now to fetch date 3times(the data) from the above query,WHAT is going to be my next steps ????
    I am not able to understand the link between the layout(.rtf document) and XML document.
    Please can someone reply to this question and let me know ?
    Regards
    Sunny

    I added a useless parameter just so you could see where parms should go...
    Datatemplate:
    <dataTemplate name="A_SIMPLE_REPORT">
         <properties>
              <property name="xml_tag_case" value="upper"/>
         </properties>
         <parameters>
              <parameter name="P_PARM" dataType="character"/>
         </parameters>
         <dataQuery>
              <sqlStatement name="QUERYNAME">
                   <![CDATA[
    select sysdate SYSDATE1
    , sysdate SYSDATE2
    , sysdate SYSDATE3
    from dual
    where 'XYZ' = nvl(:P_PARM, 'XYZ')
    ]]>
              </sqlStatement>
         </dataQuery>
         <dataStructure>
              <group name="G_UPPERGROUP" dataType="varchar2" source="QUERYNAME">
                   <element name="SYSDATE1" dataType="varchar2" value="SYSDATE1"/>
                   <element name="SYSDATE2" dataType="varchar2" value="SYSDATE2"/>
    <element name="SYSDATE3" dataType="varchar2" value="SYSDATE3"/>
              </group>
         </dataStructure>
         <dataTrigger name="afterReportTrigger" source="A_SIMPLE_REPORT.afterreport()"/>
    </dataTemplate>
    XML OUPUT:
    <?xml version="1.0" encoding="UTF-8" ?>
    <A_SIMPLE_REPORT>
    <LIST_G_UPPERGROUP>
    <G_UPPERGROUP>
    <SYSDATE1>2008-10-16T18:20:19.000-05:00</SYSDATE1>
    <SYSDATE2>2008-10-16T18:20:19.000-05:00</SYSDATE2>
    <SYSDATE3>2008-10-16T18:20:19.000-05:00</SYSDATE3>
    </G_UPPERGROUP>
    </LIST_G_UPPERGROUP>
    </A_SIMPLE_REPORT>
    Hope this helps,
    Scott
    PS If you have been doing reports for as long as you say you prob. know this already...but I NEVER* trust Oracle to convert my dates. I convert them all to char, pass them and convert them on "the other side" (if needed). But, you can change the data type to date if you feel brave, but don't say I didn't warn you. ;-)

  • Simple Narration Editing Help Needed

    Hello,
    I am brand new to audio editing and SB. I have recorded a narration. There was a little bit of background noise and the peak levels were a little too high (going into the red a little too often). I selected a piece of the background recording where no narration exists and used the "Capture Noise Print" in the Clean Up Audi0 - Noise panel to get rid of the background noise. Then I "Equalized Volume Level" to take care of the peaking problem. However, now the voice is a little on the tinny side. Can anyone suggest how I can get rid of that tinny sound and bring back the richness? Or perhaps a tutorial?
    Any suggestion on how to record with proper levels would be helpful as well.
    Thanks,
    Mike

    I have the same problem.
    Did you ever figure this out?
    Using the Effect Fix:Remove Hiss seemed to work better, but there is still a significant amount of background noise when no one is talking.
    It did seem to help to set the Noise -> Reduction value down to 30 or so using the Preview and Green switch to hear the difference.
    I'm still looking for the best workflow to cleanup a group discussion setting and would appreciate anyone else's experience.

  • Simple HTML page HELP needed

    Hi all,
    Here's my dilemma:
    I've got this simple html page that I've made with
    dreamweaver CS3. On the starting page I want to put a section
    called "NEWS", under which there would be essentially a texfield
    with the news. Now, I don't want to put the news text in the html
    code. Rather, I'd like the code to somehow take this text from a
    separate text file which I could edit at will and simply overwrite
    on the host server so that changes are seen in browsers.
    I don't need a real CMS (besides, CMS is way over my head).
    Just this one text field. I've tried with the textfield/text
    area/HTML object/etc. in the 'insert' tool but none worked. Can
    this be done at all? Appreciate any help.

    macioo1 wrote:
    > Now, I don't want to put the news text in
    > the html code. Rather, I'd like the code to somehow take
    this text from a
    > separate text file which I could edit at will and simply
    overwrite on the host
    > server so that changes are seen in browsers.
    You can do this with a server-side include. The first thing
    you need to
    do is to find out whether your hosting company has enabled
    server-side
    includes, or if you have access to a server-side language
    such as ASP or
    PHP. The way that you create a server-side include is
    slightly different
    in each type of setup.
    When you have found what your remote server supports, someone
    can give
    you further instructions.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Simple java applet help needed

    hi, im having trouble with an applet im developing for a project.
    i have developed an applet with asks the user for simple information( name,address and phone) through textfields, i wish for the applet to store this information in an array when an add button below the textfeilds is pressed.
    client array[];
    array=new client[];//needs to be an infinate array!
    I have created the client class with all the set and get methods plus constructors needed but i dont know how to take the text typed into the textfields by the user and store them in the array.
    i also need to save this info to a file and be able to load it back into the applet.
    Could some please help! Thank you for your time.

    Better maybe redefine the idea using an data structure :
    public class client{
    private char name[];
    private char address[];
    private int phone;
    public class vector_clients{
    private client vect[];
    // methods for vect[]
    What is your opinion about ???

  • Problem in Creating %rowtype records - Help Needed...

    Hi,
    I have created some base view called...
    CREATE OR REPLACE VIEW TEST AS SELECT SYSDATE FROM DUAL;
    Then i am using this view object in the function for creating row type by recreating/replacing the view by the parameter "tablename - tname".
    CREATE OR REPLACE FUNCTION abc(rs in sys_refcursor,tname varchar2 as ) return number is
    PROCEDURE CALLPROC IS
    TYPE RC IS test%rowtype index by binary_integer;
    rc1 rc;
    begin
    fetch rs bulk collect into rc1;
    end;
    begin
    Execute immediate 'create or replace view test as select * from '||tname;
    dbms_output.put_line ('Success');
    call_proc;
    return (1);
    exception
    return (-1);
    end;
    when i am executing this package
    declare
    x number;
    rc is sys_refcursor;
    begin
    open rc for select eno,ename,mgr,sal from emp;
    x:=abc(rc,'EMP');
    end;
    error:
    ====
    invalid fetch arguments list error
    Please help me out how could i trigger the record type (rowtype) object based on the passing parameters (table name).
    Thanks in advance...

    Why are you dynamically changing the table the view selects from? This seems like you are asking for trouble by forcing objects that reference view Test to go invalid when you change it. What is the purpose of the BULK COLLECT within CALLPROC? The results that are returned into rc1 are lost once that inner procedure is finished.
    What you trying to accomplish?

  • No Sound SlideShows Help Needed!!!!!!!

    Hello Everyone:  I cannot get my previously made Slideshows to play with sound in PC's that only have Adobe Reader.   The SlideShows will play with sound on PC's that have Adobe Standard or Professional installed.  My friend also has the same problem.  These sideshows were created with PSE 6,7, and 8, and the old PSA 3.  Does anyone have any suggestions on what is causing this problem and how to fix it????
    Thanks any help will be deeply appreciated.
    Robert  

    I assume you mean PDF slideshows. They open on my PC with Adobe Reader but with a user requirement to allow blocked content.
    If I click on the windows strip and authorize the file, I get to hear the sound.
    The only other option is to upload pdf's or embed them in web pages so they open instantly in a browser.
      

  • Simple Xmonad configuration help needed.

    I have no idea how haskell works at all. But I simply love xmonad!
    Could someone help me out with my configuration? It is currently
    import XMonad
    import XMonad.Config.Xfce
    main = xmonad xfceConfig
    This works pretty well for me, for the most part. However, I need a few keybinding. First, I want ctrl-alt-arrow to change desktops and I found I can do this with "XMonad.Actions.CycleWS", which I have installed and the configuration of:
    , ("M-<Left>", prevWS )
    , ("M-<Right>", nextWS )
    , ("M-S-<Left>", shiftToPrev )
    , ("M-S-<Right>", shiftToNext )
    However, I have no idea how to do this. Also, I would like XF86AudioRaiseVolume to execute "amixer set Master 5dB+" and XF86AudioLowerVolume to "amixer set Master 5dB-" and XF86AudioMute to "amixer set Master toggle". I know I could easily do this with xbindkeys or some other extra keybinding daemon, but I want to learn how to do this the correct way in haskell. Thanks!

    Is this your whole xmonad.hs ? Anyway for the keybindings part ( for multimediakeys i use xbindkeys because i use the same xmonad.hs on my laptop plus desktop ) , but you can do it without xbindkeys wich is much nicer, less apps needed. If your keys are already reconignized as XF86AudioMute then you wouldnt have to use xmodmap. You can define keys in two various ways in XMonad with the additional keysP (Util.EZconfig ) or with keys = Mykeys
    I always learn from looking into others people's configs , so here is an config from another arch user. Look for the section myKeys, and define something like :
    , ("<XF86AudioLowerVolume>", spawn amixer set Master 5dB+)
    if you are interested here is my config
    Further reference
    Last edited by jelly (2009-07-31 00:31:09)

  • Simple math operation - Help needed

    Hi, i have a simple mathematical operation to do, related to
    a shooping cart, which i want to keep simple.
    I have a input text box named QT1, where customers indicate
    quantity
    I have a dymanic text box, named ST1, where i want the value
    of QT1 to be multiplied by 10$ (hence 10)
    on the release of the button. I have a NaN answer. Here is
    the code.
    on (release) {
    var qt1:Number;
    st1 = qt1 * 10;
    And then, a grand total button will add ST1 + ST2 + ST3, with
    GT the name of the grand total dymamic box:
    on (release) {
    gt = st1 + st2 + st3;
    The second part works, but the first one, with QT1 is giving
    me a Nan (not a number) answer.
    Any help appreciated.

    Problem solved. That cary Auto-kern thing....

  • Audio recording help needed

    Is there a way to record audio from an external firewire device while recording the video from an isight camera? I'm creating online guitar lessons that would benifit greatly from a superior microphone rather than the isight camera mic.

    Jazzer,
    I don't think iMovie can deal with inputs from two different FireWire sources. Even if you try changing the sound input source in iMovie preferences it seems to have no effect.
    Have you tried the iSight microphone?
    I used it to do some voice over recording a while back and was very pleasantly surprised at it's quality.
    Though the problem might be that the best placement for audio is not going to be the best for video.
    Matt

  • Basic Recording Help Needed!

    I am recording a song that consists of 3 tracks total. I have cut out the parts that are not needed while maintaining the position of the remaining sections. How do I record a final mix that is only one track? Or, how do I burn these tracks to a disc? Basically, I have the recording and editing process done, but now I need to place the music on a disc, or at least have it all saved as one track.
    THANKS!
    LMZ

    Well, I assume since you're in the Logic forum, you are using Logic on your project.
    What you're talking about is called bouncing. This means creating a 2-track mixdown (one track for the left, one for the right). Fortunately, this is easy: just go to File and choose "bounce". From there a window will open giving you several options. If you choose to bounce as AIFF, you can take the resulting file and burn it as an audio CD in Toast or iTunes. Or better yet, you can choose "burn" which will put your smash hit directly on a disc.
    See how easy that was? Now have a pancake.
    macbook pro   Mac OS X (10.4.9)  

  • Loss of sound - urgent help needed

    Suddenly sound has disappeared from track four (have tried other tracks to no avail). I have tried everything but have obviously missed something. Please see jpg of audiomixer http://tv-moen.dk/audiomixer.jpg and http://tv-moen.dk/timeline.jpg
    Sigurd

    Your quick response is appreciated. It now appears that my system soundsettings were at fault and there was nothing wrong with the exported material. I do apologize for making this topic but in my frustration I could not see the forest for trees. This topic is therefore best deleted.
    Sigurd
    PS your observation on 1:31:11 led me to investigate from scratch. Thank you.

  • Sql query to dynamically filter out records -help needed

    Hi ,
    I have a table with structure as below
    Create table T1
    (ID Number(5),
    Action Varchar2(20)
    Below are the table contents at differnt points in time and please help me with a query which should show the results as per the entries in the table dynamically.
    Initail Table contents
    1 Queued
    2 Queued
    Query Result should be
    1 Queued
    2 Queued
    After an insert the Table contents
    1 Queued
    2 Queued
    3 Ignored
    Result
    Nothing should be displayed
    After an insert the Table contents
    1 Queued
    2 Queued
    3 Ignored
    4 Ignored
    Result
    Nothing should be displayed
    After an insert the Table contents
    1 Queued
    2 Queued
    3 Ignored
    4 Ignored
    5 Queued
    Result
    5 Queued
    Thanks in advance!!
    Best Regards,
    Sridhar

    Hi, Sridhar,
    So, you want to display rows from t1 that come after the last row with action='Ignored', which means no output at all when the last row has action='Ignored'. (A row with a given id is considered to be "after" a row with a lower id. The row with the highest id is considered the "last" row.)
    Is that right?
    Here's one way:
    SELECT     *
    FROM     t1
    WHERE     id  > (
              SELECT  MAX (id)
              FROM     t1
              WHERE     action     = 'Ignored'
    ;This does not assume that id is consecutive integers.
    If id is not unique, what results do you want? There's a chance that the query above already does it; if not, it can probably be modified.

  • Creating a very simple dice game - help needed

    I have been assigned to create a simple dice game with the result like below :
    Welcome to the Dice game.
    Please answer the following questions with 2-16 characters :
    Whats the name of player 1? a
    wrong format
    Vad heter spelare 1? Duffy
    Vad heter spelare 2? John
    Duffy throws: 6
    John throws: 4
    I have come to the "Duffy throws 6" part and have absolutly no idea how i should continue. I have tried to look up the codes in "API Specification" but found no codes / names with "dice" :)

    I have come to the "Duffy throws 6" part and have
    absolutly no idea how i should continue.How on earth should it continue??? I can't mind read unfortunately.

Maybe you are looking for

  • Faulty iDisk downloads to ipod touch

    Has anyone else experienced this problem with idisk and ipod touch? I have tried several times via apple care and my apple store to correct a problem of incomplete downloads with the iDisk application to my ipod touch. A page of four small jpeg photo

  • Document Management System in KM

    hi experts, can anyone share few points on Document Management System life cycle. can anybody give me steps for DMLC thank you, vijai

  • Samsung ML-2010 not working with 10.5.8 - HELP PLEASE

    Howdy, I know that there are others having this problem. Any advice would be greatly appreciated. I have been using a Samsung ML-2010 with Tiger (on my MacBook) and on Leopard (on my iMac) and all has been working great. Have recently caught up with

  • HELP with object carousel

    Hi, I need some help with the use of the DSM-CC object carousel. In my Xlet, I need to read a file (previsioni.TXT), that is in the package testo; this is the structure of my folder: \\mio; the first package \\ MyXlet.java \\ testo; package with the

  • Huge Time Machine Backups?

    Greetings! Why is Time Machine backing up over 31 GB of data every backup? On my MBP, I have about 70 GB of data and every single backup since Oct 26 has been for over 31 GB!!! I only plug in the USB hard drive (backup) once at night, so that's one b