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
ADVERTISEMENT
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
Feb 9, 2012
I have a VB.NET application that uses Managed DirectSound to capture audio.Everything works just fine until (a) the application is minimized or (b) the application is completey obstructed (covered) by another window.
The thing is that the CaptureBufferDescription structure does not include a GlobalFocus property so I don't know what to do to let my application continue capturing when the main window is hidden.
Here's the basic initialization code I'm using:
' Create a buffer description object
bufCapDesc = New CaptureBufferDescription()
With bufCapDesc
[code]....
View 8 Replies
Jul 13, 2009
I am developing an window application in which I have to change the size of video playing inside media player. i don't want to change the size of media player.
View 3 Replies
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
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
Sep 27, 2009
I have done an extensive search before posting this question, using many different search parameters without success at finding an answer.Using Visual Studio 2008 Express VB:My program requires a notification when a wav file has finished playing, a media player song list will not suit my needs.I have used System.Media.SoundPlayer, Microsoft.DirectX.DirectSound and My.Computer.Audio.Play to play a wav file. All work well at playing and stopping the requested wav. So far, I have not found a methode to capture an event when the wav has ended. DirectSound stops playing when the form has lost focus, so I dont think that I can use it. Audio.Play AudioPlayMode.WaitToComplete only holds up other operations and I dont want to create multiple threads.
View 3 Replies
Sep 16, 2009
i need Help to make Audio or Video Player With Using DirectX. how many Different b/w DirectX and Windows Media Player???
View 8 Replies
Jan 30, 2012
I have a problem. When I play a wav file using winmm, as soon as I click on a different command button on the form, the audio playback stops. How do I make sure the wav files are allowed to play in their entirety even when focus is moved to another control?
View 13 Replies
Apr 9, 2012
I've been fighting for weeks now to make a simple music playback program. It would function much like Windows Media Player without the visualisations and playlists. I'm writing this on a Win7 box, but it needs to work on XP and newer.
I say fighting because I'm severely annoyed at how MS has worked some items and it's taken many days to go through everything only to find that it doesn't work.
I started by using WMP in VB Express 2010 and having it play my music. Simple, but not portable. I copied my .exe to a WinXP machine and it blew up. I copied it to a different Win7 machine and it doesn't run (I can double-slick all day, nothing happens,
no log entries, nothing....)
Then I find that there is an issue with the GUID of media player on different computers, and it'll most likely fail to run when you try to use it on other machines than the one the program was built on.
So I gave up on that.
I then figured I'd use DirectX. It's on XP and newer already, and is supposed to be backwards compatibile so if I build my app on Win7 it should still run on XP and such. I did that, and it works fine on the machine I built it with (again). My shuffle works,loop/repeat works, got my own version of a playlist and it all works. I copy that to another Win7 box and it doesn't run at all. It's setup as .NET 3 so I can be sure of compatibilty with WinXP.
For grins, I gutted all the code in my VB app involving calls to Directx and built that. It runs fine on other computers, including my XP test box. So I know the problem revolves around DirectX somehow.[code]...
View 10 Replies
Nov 9, 2011
I embeded many audio file (.wav) in resources. I can inluded the following code to play a audio file My.Computer.Audio.Play(My.Resources.testWav, AudioPlayMode.Background)
But this command play only one audio file(testWav) I have two questions
1) Is there any way to play all audio files no matter how many files in Resources included in VB 2005 without typing all embeded audio file name? (using something like For Next statement)
2) Can I pass parameter to My.Computer.Audio.Play( , ), which means that when I choose one of files embeded in Resource, I just pass the chosen audio file to this command not specific file name(like testWav.wav)
View 10 Replies
Jan 28, 2009
I'm new to VB and have over the last week or two been looking at the different ways to play audio (mp3's). Windows Media Player, Microsoft Multimedia Control, Bass.dll, SndPlaySound, MCI SendString and DirectX (including audiovideoplayback, direct3d and directsound.) I originally decided to use windows mediaplayer, mainly because it seemed the logical choice but quickly found out I couldn't get it to work properly.
So I installed the Directx SDK but now I'm completely overwhelmed about what to use and why. I need to be able run the compiled code on a win 2k box, play an mp3 from start to finish then load and play another mp3 from start to finish and so on. Whats the difference between the varied choices and which would be the best for me to use?
View 5 Replies
Sep 27, 2010
Based on a thread earlier today, and in particular an answer that Cor gave wherein he
pointed to this article, I thought that I'd do some investigation. Many times here the question has come up about playing .mp3 audio files and NOT using the Windows Media Player object. In the article referenced above, he shows how this can be done via DirectX.
I've looked at DirectX before and it seemed ambiguous so I never really dug into it but it turns out to be pretty simple actually! I thought that I'd write this as a step-by-step of what I did so that maybe some of you will find use from it. The whole thing stems around using DirectX and to begin with, you'll need to download and install the SDK for it. If you haven't already,
try this link. Do be aware that it's a large download (about a half gig)! Once that's installed, create a form and add a reference to the class that we need for this. You can do this several ways, but the way I usually do is to right-click on the name in the Solution Explorer, then choose "Add Reference":
[Code]...
View 9 Replies
Dec 3, 2009
my program is designed to run on windows7. the mixer in the taskbar lets you control volumes per application. is their a way to determin if a specific application is playing a sound? if not, how would i go about checking to see if the system is currently outputting anysound.
my app is currently setup to use a speech to text and text to speech. basicly i want it to be able to wait for the text to speach software to stop talking before my app plays internal sounds (using the My.Computer.Audio.Play)
i don't have any code to provide as i have no idea where to start.
View 4 Replies
Oct 9, 2011
I am developing a video player with WPF.(in VB)I have already created a MediaElement ,ListBox, "Next" button, then start playing through reading ListBox,and use "Next" to skip to next audio/video.In "MediaEnded" event, i just copy all code in "Next" button.Now, problem is coming,
Assume the Listbox has four audios(.mp3), "test1.mp3", "test2.mp3", ......
now playing is "test1.mp3", i push "Next" button, then now playing is "test2.mp3".
However, when i just let "test1.mp3" play completed, my player will not play "test2.mp3",
[code].....
View 1 Replies
Jan 29, 2009
I am working on an application in VB.net (.NET 2.0) where I need to open a dynamic amount of different audio streams. Normally, for audio files, one would suggest importing the Windows Media Player COM reference and adding a GUI-based element from the toolbox, but since I'll be working with a dynamic amount of these a GUI would be a terrible idea (especially with Tab stops).
View 4 Replies
Apr 15, 2010
I want to create a audio player class but having some problems like when audio is finished it is not repeating. While playing audio some UI controls are not working.
View 1 Replies
Nov 12, 2010
Right now I'm trying to make an alarm clock program.I know my coding is correct and I'm not geting errors. Also my sound is a .Wav and was properly inserted into the resources folder. I was wondering if there is just some dumb setting that needs to be changed or if I'm forgeting something in the code.[code]...
View 4 Replies
Oct 15, 2011
[code]So basically the combobox1 item which is selected is sent to a string and is then supposed to be played from my resources. The .wav file which is in my resources is named "Sound1" however I have no idea how to reference it.
View 1 Replies
Jul 5, 2011
I want to do a software for blind user. How to play audio while menustrip submenu item highlight (without using mouse hover)?
View 1 Replies
Dec 6, 2009
I'm working on a program that allows a person to click on some text and it will read the text (play a wav file) using My.Computer.Audio.Play. The program calls a procedure called PlayAudioClip which uses AudioPlayMode.WaitToComplete because in some cases two wav files will be played one after the other(two languages). During the playing of the wav files I want to show a visible indicator that there is audio. I've got a picturebox called "AudioPic" who's image property points to a picture in my.resources. THe visible property of AudioPic is set to false when the form loads When the user clicks on the text my program should display the image (Visible=true), play the clip (or two) and then hide it again.
It seems that the picture is not completely loaded before the wav file plays and since I have it set to WaitToComplete it stops the loading until the wav file has played, at which time the program hides it.
How can I force it to finish showing the picture before playing the clip?[code]...
View 4 Replies
Apr 22, 2009
I am creating a windows service that will do things behind the scenes without any GUI needed, thus the need for a Windows Service. The problem is though I would like to notify the user when certain events happen by playing a short audio clip. I know Windows Service's create a virtual Desktop, in which, Audio messages are not sent to the users Desktop.
View 3 Replies
Mar 6, 2009
[code] I am programming a simple alarm clock and the loop never ends the clock stops counting seconds, and I can not click any button as the form seems to be frozen
View 2 Replies
Feb 25, 2009
For stopping by, is there a way to detect when a sound file (WAV) stops playing?
e.g.> There is a FORM with a PLAY button on which is coded to play a WAV file. But how does VB detect when the WAV file has finished playing?
Here is the code I have on the PLAY button
My.Computer.Audio.Play("test.wav", AudioPlayMode.BackgroundLoop)
View 3 Replies
Jan 28, 2010
I'm developing a standslone system for my school project. I'm developing an audio management system which allow user to add audio files itself into database together with the audio information such as artist name and album year. I just started it few days ago and face some problems.. my song in the playlist wont continue to play after 1 finished and i need some idea on how to store the audio files into database ... in blob types may be?
Heres the screenshot and codes
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_add.Click
[CODE]............................
View 2 Replies
May 29, 2010
Can you tell me how to change screen resolution using directX and automatically passing UAC. It should also turn back to the original resolution when the user exits the program.
View 5 Replies
Mar 17, 2010
I've created a media player by using Media Player Component. Let's say that I have a picture box that controls the player. I want to try if the media player is playing a file, the picture box will disappear. I've tried to put these code into Form Load but nothing change.[code]...
View 1 Replies
Jun 21, 2011
im using vb.net to open IE and go to a website... i can figure out how to size the window, but not change the windows location on the screen... how can i make the IE window position always 0,0
Dim oIE As Object
Dim hWnd As Long
oIE = CreateObject("InternetExplorer.Application")[code].....
View 3 Replies
Mar 13, 2009
I just want to ask or I need some idea on how to convert wav files to mp3 and compressed the file to make the size smaller. I've search on the internet and find vorbis.dll as a reference object and lame.exe for converter. With regards to the audio compression, i downloaded monkey's audio software but doesnt have an idea on how to incorporate it.
View 2 Replies
Jun 11, 2009
Im trying to capture the audio played on my laptop. so i have searched the internet and found a source code for doing exactly that. the problem i have is that my audio device is not listed in the dropdown box (see picture) but it does when its run on windows xp (im running windows 7 x64) the goal of this application would be to capture my friends radio stream and save the individual played mp3's to a loction on my hard drive.(yes i have permission) i have included the source code so perhaps some 1 could have a look at it. (source code)[URL]
View 2 Replies