How to play a wave file through the DAQ board?

Hi there,
we want to play a wave file that is saved on the harddrive via the DAQ board. Means we want to connect a amp to the analog output of the DAQ to amplify the sound and play it through a speaker.
We couldn't find any VI that does that. Can anybody tell us how to play a wave file, or perhaps even send us a VI that can do that?
Thanks a lot for your help
Martin - Physical Optics Corporation

Hi Martin,
The only example that I could find on how to do this was using our
older Traditional DAQ drivers version 6.9.3.  If you're using Traditional
DAQ drivers, the vi can be found here. 
The example reads a 8-bit mono .wav file (an example .wav file is included in the .zip file) and writes it to the analog out of your DAQ card.  I've updated the
example to work with our newer DAQmx drivers and attached it here.  
I hope this helps,
Paul C.
Message Edited by Paul C. on 08-14-2007 05:47 PM
Attachments:
daqmx_wav_file_to_ao_output.zip ‏27 KB

Similar Messages

  • How to play an audio file through a button?

    I have a form in which I have a button (Command object). When the user clicks on this command button it is supposed to play a wav file. The wav is residing in my hard disk at "C:\tada.wav"
    I have tried to include the following code in the commandAction() method, which technically is the right way of performing this operation:
    But I get a warning when I compile saying that this operation should be performed in a seperate thread as opposed to commandAction().
    if(c == cmdPlay)
    try     
    String wav = "file:///c:/tada.wav";
    Player p = Manager.createPlayer(wav);
    p.start();
    catch (IOException x)
    x.printStackTrace();
    } catch (MediaException x) {
    x.printStackTrace();
    Can anyone please tell me how to implement this solution properly or just suggest a new way of creating a "play" button in my form? Urgent HELP NEEDED PLEASE!
    THANKS.

    Hi Ibrahim,
    Rob has pointed you to the Lingo for playing a sound. There is a behavior in the Library Palette that makes this very easy without needing to write a script yourself. In the Media > Sound category, there is a 'Play Sound' behavior. You can click and drag this behavior onto a sprite and then in the Parameters dialog, you can choose the sound to play, the channel in which it should play, the event to activate the sound, and if you want the sound to loop.
    Dean
    Director Lecturer / Consultant / Director Enthusiast
    http://www.deansdirectortutorials.com/
    http://www.multimediacreative.com.au

  • How to play a wav file to LINE_OUT with javax.sound.sampled

    Hello all,
    I need to play a wav file to LINE_OUT port, but not to the SPEAKER. I am trying to do this under window NT. For some reason I get false for isLineSupported(Port.Info.LINE_OUT). I am new to javax.sound so I might be doing something wrong. Here is the code that I am using to iterate through all availible mixers and check if LINE_OUT is supported by any of them:
    Mixer.Info[] mixers = AudioSystem.getMixerInfo();
    for(int i = 0; i < mixers.length; i++){
    Mixer mixer = AudioSystem.getMixer(mixers);
    if (mixer.isLineSupported(Port.Info.LINE_OUT)) {
    System.out.println("the port is supported");
    try {
    Port line = (Port) AudioSystem.getLine(
    Port.Info.LINE_OUT);
    catch(Exception ex){
    ex.printStackTrace();
    else{
    System.out.println("the port is not supported");
    Please help

    The new bugID of the request to implement Ports is: 4558938.
    (If you voted for the old bug id: 4504642, be sure to change your votes to this new bug report since the old one was closed as a duplicate of the new one.)

  • How to transfer a binary file through the socket?

    hi,
    i have a problem when I want to transfer a binary file through the socket. On the server side we write a program with C. On the client side with use java. The socket worked fine when we transfer some asci files. But failed when transfer the binary file. How to solve the problem? Can someone give me some advice? Thanks a lot.
    sincerely,
    zheng chuanbo

    i use streams to read the binary file. The problem is I don't know when the transfered stream finished. With text file I can recognize the end of the transfer by a special string, but how to deal with the end of a stream? should the server send an "EOF" or something else to the client to notify the end?

  • How to play an audio file from the begin.........

    Hello to everybody,
    I am working on a application that is supposed to manage audio file. At the moment I 'm using the SourceDataLine instead of the Clip. But I've got a problem. When the user pushes the Stop button I want that if he pushes Play again the track starts from the begin. I've used the drain() and flush() method but it doesn't work because the track resumes from the point when has been interrupted. Here part of the code:
    @Override
    public void run()
    try
    if(dataline!=null)
    dataline.open(audio_format);
    dataline.start();
    int i=0;
    while((i=audio_input_stream.read(buffer, 0, buffer.length))!=-1 && flag==false)
    if(i>0)
    dataline.write(buffer, 0, i);
    dataline.drain();
    dataline.stop();
    dataline.flush();
    dataline=null;
    dataline.close();
    And also I'd like to know how to navigate through the audio file by a slider or something like that, so how much time is passed.
    Thank you in advance.
    Maurizio Di Vitto

    mauriziodvt wrote:
    I've tried to use it but I found out that if I use quite large wav files an exception is thrown, Aha! I expected as much. That is why I developed BigClip.
    ..so I thought to change to SourceDataLine even if Clip has the right stuff to manage my audio files. So what do you suggest? Is there a way to avoid such problem? I mean, how can I be sure that I'm able to use every wav files? Not every WAV file can be opened using SourceDataLine, but if SDL can open it, so can BigClip.

  • How to copy a .bak-File through the Net with a Job?

    Hi all,
    I have create with
    ALTER DATABASE BACKUP CONTROLFILE TO 'c:\Temp\test_control.bak';
    my the binary copy of my controlfile.
    But I don't understand:
    In the database there are 3 control files: Control01.ctl,
    Control02.ctl and Control03.ctl. After I implemented ALTER DATABASE BACKUP CONTROLFILE TO 'C:\Temp\test_control.bak';, I have
    only one copy. Is that the copy of all 3 controlfiles? Still another question:
    How can I copy this file now with a job on another computer through the net?
    Regards
    Leonid Pavlov

    i use streams to read the binary file. The problem is I don't know when the transfered stream finished. With text file I can recognize the end of the transfer by a special string, but how to deal with the end of a stream? should the server send an "EOF" or something else to the client to notify the end?

  • How do you load wav files in the EXS24?

    Hey all - I'm new w/the EXS24 and am trying to import wav files off a sampler CD I bought. I can't figure out an easy way to do it. When I imported some Akai CD's before, it was as simple as opening AKAI convert and inserting the CD. Now, when I go to the "load mult-sample" for these wav's - it wants me to do everything one at a time. Surely, there's got to be an easier way than loading hundreds of samples one at a time. Any suggestions from all you EXS24 pros out there?

    If you can get to the instrument editor, drag and drop your regions or files onto the keyboard and answer the following questions. To preview it have an EXS24 loaded up with EXS Instrument #5678 (or whichever number it happens to be.

  • How to play DTS wav files on hd from sounblasterplay

    Hello,
    I've got many wav files on my harddisk. They are dts wav files.
    On cd-rom they play with software player soundblaster, no problem.
    But when i play them by harddisk there is no dts sound.
    What must i do to play them?
    greetings

    forgotten to say it is a X-fi music card
    thanks

  • Visual wave files in the play bar

    How do I bring back the visual wave files in the play bar? They've disappeared since the last upgrade.

    On my 8 year old iTunes there's a little triangle on the left you click to change displays.  Have you tried clicking around on things there?

  • I have few PDf files on my computer and I want to add them to my ipod touch, please tell me the procedure on how should I do that? Secondly I want to run these Pdf files through the ibook app, as it also have the Pdf file sections

    I have few PDf files on my computer and I want to add them to my ipod touch, please tell me the procedure on how should I do that? Secondly I want to run these Pdf files through the ibook app, as it also have the Pdf file sections

    You should be able to just place them in your Books library in iTunes and check to ensure that your Book library is configured to sync to your iPod when you sync your iPod to iTunes.

  • Can any one tell me how to attach a pdf file to the mail through workflow

    I have a smart which i am able  to convert it to a pdf file...now.. can any one tell me how to attach a pdf file to the mail through workflow

    Hi,
    To create the task for attachment
    Use the BOR SELFITEM and method NOTES_APPEND.
    The out come of this task contain a link called attachment with a clip attached. Clisk on that icon and choose the type of attachment u want . RAW , EXCEL , TXT , PDF... Then using the import icon u can attach the document u like.
    But the TYPE : OBJ.
    Similarly using NOTE_DISPLAY method u can display the documents u like.
    In any work item u have the facility to attach any atttchment for further circulation .
    Attchment @ WORKITEM
    1.Click the workitem for which you want to create the attchment
    2.Press create attachment
    3. Add the attachment u like (PDF)
    Reward points for useful answer.
    Richard A

  • How to play a video file stored locally in the system

    hi
    how to play a video file stored locally
    thanks
    mraj

    Hi,
    You can't do that in a simple way. You need to have a port open in the firewall, and you need to have a server process on the remote machine.
    Kaj

  • Subsequent play of WAV files from HTTP

    Hi,
    I have to subsequently play many WAV files from HTTP in a nokia series 60 emulator.
    Everything is ok for the first two files, but at the third I catch an exception:
    "java.io.IOException: exceeded the configured maximum number of connections"
    I tried two ways to load the files from HTTP:
    Manager.CreatePlayer(InputStream...)
    Manager.CreatePlayer("http:\\...")
    Below there is the code of the two methods I use. Please note that I try in every way to close the connection before open a new one!!!
    public void Method_1(String src, String type){
    int iLen=0;
    is = null;
    httpCon = null;
    byte[] bBuf;
    try {
    if (p != null) {
    if (p.getState() == Player.STARTED) {
    p.stop();
    p.removePlayerListener(this);
    p.deallocate();
    p.close();
    p=null;
    if (is!=null){
    is.close();
    is=null;
    if (httpCon!=null){
    httpCon.close();
    httpCon=null;
    httpCon = (HttpConnection) Connector.open(src);
    if (httpCon.getResponseCode() != HttpConnection.HTTP_OK) {
    System.out.println("Bad response code");
    return;
    System.out.println("Connection OK! (audio)");
    iLen = (int) httpCon.getLength();
    System.out.println("audio file length : " + iLen);
    is = httpCon.openInputStream();
    p = Manager.createPlayer(is, type);
    p.addPlayerListener(this);
    p.setLoopCount(1);
    p.prefetch();
    p.start();
    vc = (VolumeControl)p.getControl("VolumeControl");
    catch (MediaException ex) {
    ex.printStackTrace();
    catch (IOException ex) {
    ex.printStackTrace();
    public void Method_2(String src){
    try {
    if (p!=null){
    if (p.getState() == Player.STARTED)
    p.stop();
    p.deallocate();
    p.close();
    p=null;
    p = Manager.createPlayer(src);
    p.addPlayerListener(this);
    p.setLoopCount(1);
    p.start();
    vc = (VolumeControl)p.getControl("VolumeControl");
    catch (java.io.IOException e) {
    e.printStackTrace();
    catch (MediaException e) {
    e.printStackTrace();

    My question is:
    how can I load (from a HTTP server) and play more than two WAV files without crashing?
    Do I have to close the connection in a better way in order to re-open it without problems (and more than two times)?
    It is simply an emulator bug?
    Thanks.

  • Play a wav file once

    how do I play a wav file just once using the play sound
    file.vi. i keep getting it to repeat over and over
    thanks

    First may I recommend some reading here. This is not meant to be cocky just to help you.  
    Getting Started with NI LabVIEW Student Training
    LabVIEW101
    Second I have included sort of template. Notice the wire that ends in the while loop. This will ensure that the wav is played before the loop starts.
    Good luck with your Labview labwork
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)
    Attachments:
    play wav file[2].vi ‏9 KB

  • Need Help playing a wav file on PDA

    Does anyone have a SIMPLE example of playing a wav file on a PDA using LabView PDA. The only working example I can find from NI "Advance Sound Example for LabVIEW PDA for Pocket PC" is a jumbled of confusing functionality. I'm mainly looking for a simple "play" example, but a simple "record" example would be helpful also.
    Thanks - Bruce

    Hello,
    Well, I looked through the example code I tried to break it down to the point where you could create a simple Play VI. Unfortunately, I don't have the PDA target, so I'm uncertain if the little example that I have attached will run or not. If not, I also took a screen shot so you can see what VIs I used. I'm pretty sure I only used VI's that I found on the example itself.
    Good luck.
    Attachments:
    Play_Wav_PDA.vi ‏55 KB
    Play_Wav_PDA.bmp ‏1029 KB

Maybe you are looking for

  • Migration assistant and iphoto

    While transferring data from my ibook 3.9 Panther to my new mac mini with firewire migration assistant manually with i think a drag and drop technique, the photos transferred but the albums did not. Same with itunes playlists but not bothered with th

  • OIM cannot create a user

    I am trying to manually create a user in OIM (10g) and it is not allowing me. I get the following error message: DOBJ.SCHTM_NO_MIL The definition of task could not be found. I have seen a lot of other posts where people say to post the log where the

  • Shipping question for recalled Ipod nano

    Will apple notify me when the recieve my recalled ipod nano? Will i be notified when they ship the new Ipod back to me?

  • Log4j Error - Help needed

    Hi All, I am getting this following stack trace when i execute a test on an application on the remote server from the client. THe stack trace is as follows. It says error in the java.lang.NoClassDefFoundError: org/apache/log4j/Layout.... Thanks in ad

  • IPhone Development Book Questions

    My apologies if this should have been posted elsewhere. My question are: 1: Is there an iPhone Dev forum on this site? 2: Will an iPhone book written for the iPhone 3 benefit a person wanting to program for the iPhone 4? Thanks!