Playing Multiple Sounds Without Using DirectX

Feb 1, 2010

Is it possible to stream more than two sounds simultaneously in .NET without using DirectX?

To obtain foreground and background effects I currently use the following:

' Background music
Private bkMusic As New SoundPlayer(My.Resources.bkm)


[CODE]..................

SoundPlayer is a wrap around to the win32 API:

Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

While for actual in game sound effects I am using a class that implements:

Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpszCommand As String, ByVal lpszReturnString As String, ByVal cchReturnLength As Long, ByVal hwndCallback As Long) As Long

It works. 1 snd effect at a time overlapping / mixing with the background music. But I am on the hunt for a better method which allows me to stream multiple snd effects simultaneously. DirectX is not an option, because most people (my audience) don't have the SDK (software development kit)

View 4 Replies


ADVERTISEMENT

Multiple Sounds With Directx?

Dec 22, 2009

i have a little project I have been working on over the past few days just a simple piano project, during making it I used directx sdk To allow me to play multiple wav files at the same time. everything worked out great got the piano working and was able to play some sound effects while I banged out a master piece on the piano . So the next step was to make an exe file , I knew that once I used directx sdk I might run into a problem when trying to make an exe to run on all my PCs that dont have directx sdk installed on them .

My question is it possible to make an exe that will allow my program to run on any pc even without directx sdk installed?

View 4 Replies

Playing Two Sounds At A Time?

May 26, 2012

how do you do this playing two sounds at a time?

View 4 Replies

Playing Two Sounds Simultanously?

Nov 8, 2009

Is it possible to play two sounds using SoundPlayer simultaneously. I have got 2 sounds, one a music file which keeps on playing in the background and a message sound that will play if some condition is true over that sound. Is it possible??

View 4 Replies

Playing Sounds (.wav, .mp3, Etc) From Gamepad Input

Nov 22, 2009

[URL]

I just got back into VB since being, at best, a hobby programmer with VB6. Wow, so much has changed since then, so I feel like I am starting all over again.

After much hunting and searching, I found that great code sample that shows the input from the game pad/joystick. (Finding visual basic 2008 and gamepad input information isn't easy!)

Now I want specific buttons to play a random file from a specific folder.

The application runs on a Netbook, which is a bit light on resources. I would prefer to play WAVs and MP3s with something that's less resource intense than windows media player. (Perhaps its very easy to do so from the code level. I've noticed WMP is so loaded with visualizations and so forth, its hard to turn all that crap off)

View 7 Replies

Add Effects To Sounds That Are Playing Using The Mediaplayer Control?

Sep 15, 2009

is it possible to add effects to sounds that are playing using the mediaplayer control?. i have tried using directsound which works good and i can add effects to the sounds playing but it wont play mp3 files and i have looked all over for information on directshow which does play mp3s but all the examples i managed to find all have about 50 lines of code just to play one track and dont show how to add effects.

i need to play several sounds at the same time and add different effects to each track and also be able to play - stop - pause each individual track at will mediaplayer i can do this but dont know how to add effects directsound i can do all of this but cant play mp3s.is there any way to add effects using mediaplayer control? or does anyone please know where i can see a code example in directshow that adds effects to the sounds playing?

View 2 Replies

Game Programming :: Playing 2 Sounds At One Time?

Feb 19, 2009

Its me again the newb programmer. lol why does it not allow you to play 2 sounds at the same time? the back ground loop ends when the button click sound is played :/ and I'm using vb express 2008 .net

[Code]...

View 1 Replies

Playing Video Using DirectX ?

Sep 18, 2009

I have scoured just about every code sample on the web, and am still having trouble. Basically my code follows the following structure:

I installed the DirectX SDK, and imported AudioVideoPlayback Imports Microsoft.Directx.AudioVideoPlayback '''

Then I create my VideoPlayer Public WithEvents VideoPlayer as Video So far so good, I have event handlers and a video object

Then:

[CODE]...........

I execute the above subroutine and the video plays flawlessly

[CODE]............

The above code works perfectly as well

Then I try to execute the PlayVideo sub to play another file and I get a generic "Object reference not set to an instance of an object" error, that does not point to any particular line of code. It took me forever to find out exactly what line of code was causing this. So I came up with a workaround:

In the PlayVideo sub I changed the code to this

[CODE]..............

And there it is, the second video played without error. but then I noticed something, after the second video ended the .Ending event handler did not fire, actually all the event handlers basically died. So someone told me to use a timer to monitor when the video ends, and I basically laughed it off since we know that's an amateur move. After being frustrated for a while, I caved in and used the timer to do my dirty work, which I really don't like.

Now there's another problem, after I play a video in my project, DirectX is not screwed up for other programs until I restart my computer. Particularly I have a visualization plugin for Windows Media Player called Gforce. After I play a video, Gforce will not work, it gives me an "Error=18" which means that my computer does not have sufficient hardware to use it. The only way to be able to clear it up is to restart my computer.

Here are my specs:
Intel 3.0ghz Dual Core processor
Nvidia Geforce 9800GT with 1GB ram
4 GM Ram
Windows 7 64-bit version (build 7100)
Programming in Visual Studio 2008 Professional (using Visual Basic code)

I originally attempted to use the AxWindowsMediaPlayer control, but I am unable to. According to Microsoft there is a bug that prevents me from using it. When I pull up the choose items dialog box it does not show up, if I browse to wmp.dll to manually add it, I get an error ("self-registration for c:windowssystem32wmp.dll failed"). I also read that you should try to add the wmp.ocx instead of wmp.dll, but I am at a loss on this since I am pretty sure that file does not exist. I am trying to put together a new media player program for my theater pc and this video thing is putting me to a standstill. I am a highly experienced vb programmer (over 20 years), but I am not very experienced in DirectX. I have read a lot of code samples on video playback but they all give me tons of problems, so I hate to say it but i think that most of these samples were written by people who don't know what they are doing.

View 2 Replies

Make An Option For Making A Playlist Instead Of Playing The Sounds Right Away When Press The Button

Nov 7, 2010

I have a Form that has several buttons on it, and each one plays a certain mp3 file. Thing is I want to make an option for making a playlist instead of playing the sounds right away when you press the button, adding them to a ListBox. So the code would look something like this on Button1_Click

[Code]....

View 18 Replies

Directx Audio Stops Playing When Change Window?

Sep 15, 2009

So I have a wav playing using DirectX in VB6. If i switch to another window, it stops playing. If I click back on the VB6 window it resumes play. How do I make it continue playing when I change windows? Another problem I cannot load wav files larger than 50 megabyte. It says Out Of Memory. How can I increase that?

View 1 Replies

VS 2010 Cannot Dispose DirectX Audio Object After Playing?

Nov 14, 2011

I'm playing an audio file like so:

VB.NET Dim audio As New Audio(Application.StartupPath & "est.wav", True) audio.Balance = 10000 audio.Play()

Which works great. But if I need to change that file, I get an UnauthorizedException because the I haven't disposed of it. But, if I add a dispose after .Play, it won't play.

View 2 Replies

Play Multiple Sounds Simultaneously From Resources?

Dec 13, 2010

I want to play multiple sounds simultaneously from My.Resources in Visual Basic 2010. I have tried:My.Computer.Audio.Play(My.Resources.SoundName, AudioPlayMode.Background)

I have also tried using multiple Windows Media Player controls, but that also didn't work.The first sound is cut off when the next sound plays.When searching around the internet I found people suggesting using 'DirectSound', but there are only tutorials for DirectSound in VB 6.0.

View 1 Replies

Playing Multiple And Overlapping Wave Files?

Jan 30, 2012

I'm trying to write a virtual piano program. Each key plays a sound from the resources directory.How do i play two(or more) sounds at the same time if ex two keys are pressed. Or start playing another sound while one is still playing.

View 2 Replies

Playing Single Video In Multiple Forms?

Mar 3, 2010

if i have mediaplayer1 in Form1 and mediaplayer2 in Form2 than how can i play and control a single video file in both mediaplayer1 and mediaplayer2 in vb.net

View 1 Replies

VS 2010 - Playing Multiple Files From Array

Feb 26, 2011

I'm trying to make a "Simon" game with four buttons labeled 1-4. The game is supposed to read the numbers out loud, but i have a problem with that. I have 4 wav files from google text-to-speech, each named 1-4. I made an number generator that can return like this "42331", and the game is supposed to play 4.wav, 2.wav, 3.wav, 3.wav and 1.wav.

Here's what I got so far.
Public Class Form1
Dim rnd As New Random
Dim i = 0
Dim level As Integer = 5
Dim nums As String
[code] .....
It only plays 1.wav (the last in the sequence).

View 4 Replies

Get Media Playing Now Playing Using Sendmessege / Wmp.dll?

Jan 22, 2010

How I can get the Media playing now playing using Sendmessege or wmp.dll?

View 5 Replies

How To Play Sounds In Vb 9

Nov 25, 2009

well i wanted to make a piano with visual basic 2008 and i searched around the internet to see how to play a sound but my search returned results relating only to visual basic 2005 & 6 so i am again forced to waste your time

View 3 Replies

Mute Sounds JUST From An App?

Apr 8, 2010

How can I mute sounds JUST from my app?

View 20 Replies

Play Wav And Mp3 Sounds Using .net?

Apr 23, 2010

i need a way to play wav and mp3 sounds using vb net. its has to be able to play more than one sound at same time and also to play the same sound again even if it has not finished playing

i tried this

Code:
Dim ch As String
ch = Chr(34) & TextBox1.Text & Chr(34)
mciSendString("open " & ch & " alias s1", Nothing, 0, 0)
mciSendString("play s1", Nothing, 0, 0)

it plays the sound once then will not play any other sound at all.

View 1 Replies

Why Cant Hear Any Sounds

Nov 23, 2011

Turns out, visual basic cant play wav files under 100 kb :S, just needed to edit my wav file with audicity to extend it and increase its size.

View 3 Replies

Click The Button Sounds ?

Jun 4, 2011

I need help for button sound that when i click the button sounds.

View 2 Replies

Grab My Background Sounds?

Feb 10, 2010

Is there a way to hook the computers sound card and record the sounds?

View 2 Replies

Play 2 Or More Sounds At The Same Time

May 4, 2011

What is the simplest way to play two or more sounds at the same time? It should be a light software.

View 3 Replies

Possible To Play Two Or More Sounds At Same Time?

Feb 2, 2009

Is it possible to play two or more sounds at the same time (i.e., one plays in the background and one plays a sound effect) and if so, how can I do this? I am having problems because it is cancelling one of the sounds out when the other starts.

View 7 Replies

Resolved How To Play Sounds In Vb 9

Oct 29, 2009

i wanted to make a piano with visual basic 2008 and i searched around the internet to see how to play a sound but my search returned results relating only to visual basic 2005 & 6 so i am again forced to waste your time (sorry about that) oh and i also have the wav soundfiles i only want vb to read them in the final exe

View 3 Replies

Sounds - Play Two .WAV Files At Once

Dec 7, 2009

I am making a program that plays a sound whenever you hit a button, and was wondering if there was a way to play two .WAV files at once. Here is what the code looks like:

[Code]...

View 8 Replies

VS 2008 Play 2 Sounds At Once?

Dec 11, 2009

How do i play 2 sounds at once? i have a sound effect on a button, and when i press it, it does the sound effect of the button and stops the music sound

View 3 Replies

Adding Sounds Like Clicks To Program

Jul 1, 2011

i would like to add sounds like clicks to my program. for example someone clicks a button and a buzzing sound would occur.

View 3 Replies

C# - Recording And Saving Sounds From Applications?

Oct 17, 2009

I Would like to make an appliaction in c# (or vb.net) that records every sound that comes out from the speakers when i tell it to, and when im finished i want to push a button and save it as an mp3 (or some other format).

So far i have only found APIs that can record something from a microphone.

Is there anything in the .NET framework or is there some API for making this possible?

View 1 Replies

Deleting Controls (sounds Dumb)?

Oct 29, 2009

I was transferring a lot of controls from one form to another and somehow along the way I ended up with a lot of "extra" controls and apparently when you do this they don't retain their Names so they are all default-type names (Label1, Textbox1, etc)I can see them all listed in the properties window dropdown box, but they are not on the form. Selecting them from the dropdown does not reveal where they are at on the form either.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved