LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to output multiple waves to soundboard

Solved!
Go to solution

Working on two projects that could benefit from multiple sounds being played at once.

 

1st is a C64 SID emulator. The SID has 3 voices Each with there own ADSR and waveform. I can generate a single waveform with attack and decay and get decent sounds out. But mixing has Been problematic. I want to have almost 3 loops running together. Each sending waveforms to The soundboard. I've done this before in VB...hmm...im thinking maybe I used directx.Been awhile. Guess I could import an activex object that handles playing sounds? Ill search on that idea. Any others would be helpful

 

2nd is a game_API. I see boring games done for labview. Like checkers or chess. Using 2d array of images. Been there done that (reversi). So I started out on a basic game_API loading sprites and displaying on a picture. What I Need is music and sound effects. Need to play one music in The background and then during jump or fire play those sounds. Kind of along The same lines as my other project.

 

Side question: Load and play MP3 files in labview? So far I can get The frame header..Then What do you do? I can't find The decompress info anywhere only frame header information. Not that important I just was searching music playing and saw no one has done mp3 So I tried it but got stuck.

 

-pRoFiT

- A minute saved is a Minute earned!
0 Kudos
Message 1 of 4
(2,857 Views)
Solution
Accepted by topic author pRoFiT

In case someone is searching like I was. Searching around Some more I found someone that used the winmm.dll mcisendmessage to open a CD drive back in 2005. Using that dll call you can also play sounds. In my example attached I used a wav file but I think mp3 files should work too. Not sure if a memory leak will happen with this example. As I don't know how to clear the alias I created. Some more code to watch the sound process and clear the alias setup once the sound is done may help or be needed. But this example should get someone moving in the right direction.

 

p.s. im still in search of a good way to play 3 waves created in labview at the same time. In fact more control over the labview soundplay vi would be nice.

 

edit: hmm I took the snippet of the default failed to open side. The Only difference is instead of close I use play to play the sound after an alias has been created.

 

Not the alias part allows you to play multiple sounds at once. Only using [play "filename"] will result in waiting for it to end before you can send the next sound. Alias is the key to making this work.

 

edit: Used labview 2011.

- A minute saved is a Minute earned!
Download All
0 Kudos
Message 2 of 4
(2,831 Views)

Check this out too.

=====================
LabVIEW 2012


Message 3 of 4
(2,802 Views)

Nice i didn't know NI posted the Angry Eagles demo.

 

Looks like there using .net and a custom dll for there sound implementation. I may stick with winmm.dll since its a built in windows dll and i wont have to include simonsimplesound.dll.

 

Steve, Are you working on a LabView game too? I was just testing the waters to see if i could draw sprites at decent speeds in labview. Seems like the angry eagles demo is smooth. I was just about to start digging through my GDI+ programming book to see if i could implement some of the GDI+ features into labview. I dont see anyone doing it and im not sure how i pull the graphics out of it and into labview smoothly.

 

Anyways would be intresting to hear what you are working on.

- A minute saved is a Minute earned!
0 Kudos
Message 4 of 4
(2,776 Views)