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
ADVERTISEMENT
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
Jan 11, 2012
I am having a _ton_ of issues, and I am hoping some of you could clear it up...
1. OK So a while back someone showed me an example for fonts from resources, but I noticed if you close the window that it opens, The entire program shuts down... what can I do to fix it?Also, The fonts are not showing up on all computers, only this one....
2. I am trying to delete a image file, which the program downloads from the internet, and can change regularly, but when I try to delete it will not delete. It says its in use, and I cant figure out where.
3. I am trying to play videos using the following
vb
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer
Const WS_CHILD As Integer = &H40000000
[code]....
Now, I have confirmed the files it is attempting to play are in fact valid video files. It refuses to play all but the last one.
View 3 Replies
Aug 25, 2009
I have to rename a bunch of folders in different directories. What I would like to do is type in a directory and rename/move files into another directory. I have 4 txt files right know, one for the old file names, one for the new file names, and 2 for the directories.
I planed on importing the txt files into 4 arrays and then using the rename function to change the directory going through a loop.
Problem is I'm very very new to VB and have no idea how to import each line of the txt file into the array.
View 7 Replies
Mar 28, 2011
I'm trying to copy multiple files from a directory, put them into an array, then copy just the 30 newest files(I haven't coded the 30 newest loop yet). I added a list box to the following code just to ensure the all the files are storing into the array properly... they are. When it try's to copy, it renames the first file to .log, then tells me that the .log file already exist. How do I get it to copy and keep the source file name in the destination folder Eventually I'll loop this and grab only 30 of the files.
Here's the code I'm playing with:
Private Sub transferButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles transferButton.Click
[code].....
View 2 Replies
Sep 28, 2011
I'll explain what I'm working to eliminate the assumptions of a brute forcer. I'm working a Random SQL Data generator. What I need is a way to create a multi-dimensional array from multiple word lists, 1 dimension per word list. I have tried a few different things and nothing I've tried works. However, I have got it to work with a single word list and an array of 1. I figured there is a more efficient way of doing this than writing a massive block of select case and using multiple 1 dimensional arrays, this would end up very messy and inefficient it seems.No this is not for homework, this is for personal learning use only.I would post my code, but like I said, nothing I've tried comes close to working.
View 5 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
Aug 19, 2010
I use to ZIP one file:
Public Function CompressFile(ByRef file As String, ByRef destination As String) As String
'Make sure user provided a valid file with path
If IO.File.Exists(file) = False Then
[code]......
But I can't manage to ZIP more then one file! I've tried using an arraylist.
View 4 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
Jun 21, 2010
I want to play MP3 Files directly from the internet. I don't want to use other applications, like WMP, just my application.
I have a file that contains the list of the playable files: listoftracks.ini that contains:
hxxp://....../example.mp3
hxxp://....../example2.mp3
I wrote hXXp instead of http to disable links - in the files, they are http
Public Function Listen()
My.Computer.Network.DownloadFile("..../listoftracks.ini", Application.StartupPath & "/listoftracks.ini")
[Code]....
View 5 Replies
Oct 3, 2010
This is tied in with the other discussion that I started last week about playing audio files using the DirectX classes. If you haven't yet had a look at that other thread,Using the same reference as in the audio application, let's set up a form for video this time. I started with a form that I then placed a split container on and in the lower panel of the split contatiner, I placed the buttons and other controls. Following is how I have mine set up:
Reread the thread on the audio player because the methods are very similar - in fact some are identical! However, this is video and it got a bit more involved as you might expect.The full code is here and I hope you'll find it useful to you. Following is a screenshot of the end result.
View 2 Replies
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
Apr 24, 2010
I know how to send one file, and ive tried to loop that. But then i get error 500 or 550. So what is a good way to send multiple files over FTP?
View 4 Replies
Aug 20, 2011
My current code is Imports System.Net Imports System.IO Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click#
Using wc As New WebClient()
wc.DownloadFile("http://link.com/1.swf", Path.Combine("1.swf"))
End Using
End Sub
End Class
And that work's like a charm, however say there was swf's from 1 to 2700 or so, how would i go around making it download each of those files one at a time or all at once? I could do a loop but I'm not the best in Visual Basic 2010
View 25 Replies
Oct 31, 2010
I'd like to convert a VB6 application to .Net. It downloads multiple files at once and the progress is shown in a Listview. I'm using the Winsock control in a Usercontrol. Every time I start a new download a new instance of the Usercontrol is loaded. This way I can easily download 25 files at once with very low CPU usage.
I looked into the WebClient Class to download the files, but I noticed it only downloads two files at a time. Other downloads won't start unless one of the first two downloads are finished, but maybe I'm doing something wrong.
1) What's the best way to download dozens of files at once? It must be possible to resume the downloads.
2) How do I keep the downloads apart (index number?), so the Listview can be updated accordingly? I don't need help with the Listview itself.
3) Should I use the Backgroundworker or not?
View 11 Replies
Mar 11, 2011
I'm using a WebClient to download a bunch of small files from a website, but doing them one at a time takes a long time, approximately 20-30 minutes for all of them. Is there a way to download multiple files simultaneously, to shorten the time it takes?
View 1 Replies
Sep 20, 2010
I just started playing with VB, so please excuse my ignorance. I've been trying to find an answer in existing threads, but all the stuff there is very confusing to me.I wonder if somebody could create a complete code for me and paste it in an answer to this post.
Basically, what I need is: In VS 2010 - Windows form.
1. Click a button.
2. Grab all files from specified folder on my computer (different extensions = html, txt, bat and some other).
3. Load all the files to specified folder on FTP server replacing existing files without prompt.
4. Display confirmation if succesful or error message. (a progress bar would be handy, but this isn't crucial).
The folder on my computer is always the same folder The folder on the ftp server is always the same folder[URL]..I need to specify username and password for the FTP server
This should all happen without any input from the user - simply click and message saying 'it is done' once all the files were uploaded.
View 14 Replies
Jul 4, 2010
Is it possible to play 8 different and individual mono wave files to a 7.1 (8 channels) audio system using vb.net? (I undestand that the .1 speaker is the subwoofer and I'm not yet sure it can be replaced with an ordinary speaker.) The playing should start simultaneously and the files can be of different size/length.Is this something that should be done using win API functions if it can be accomplished at all.I just re-installed my old VB6 which I need to ugrade and vb.net would be the easiest for me so I placed this Q here.
View 2 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
Jan 2, 2010
I do not want to use a hidden player or anything. I want to play it through code.
View 5 Replies
Sep 10, 2009
im new to VB and i would like to ask some questions;Im developing a Media Study Room program and i have this little problem, My problem is that, how can i designate the video in the list box, that when i click variable on the list, it will automatically play the video i designated to a number and its description in the bottom will appear.
View 18 Replies
Jul 11, 2011
I have an application which has multiple files .rtf I open it on a rich text box.
Here is my code for print preview
PrintPreviewDialog1.Document = PrintDocument1
PrintPreviewDialog1.ShowDialog()
I press the button for preview and it shows me the preview. But if I change the content of the rich text box with another file, the print preview shows me empty. How I can send it to a new preview?
View 1 Replies
Jul 8, 2011
I have a Listview and OpenFileDialog. I'm trying to add multiple files to listview but code is not working.
View 3 Replies
Aug 30, 2011
i need to check a text in a lakh of files. as now am looping through files, is there any other fast approach to make it work easily.
View 6 Replies
Jun 23, 2010
We have code in our former VB6 application, that ported fine to VB.NET, that plays a simple AVI file of the typical "flying folders" and "spinning maginfying glass" AVI. Under Windows XP, our application ran fine and everything was good.
Then we had customers start using Vista and Win7 and this stuff crashes. We were using the MS Common Controls (SP4) and then (SP6) - utilizing the Animation player. Now - these dont work and we get nasty errors.
I searched Microsoft and the web to answer the "what now?" question and though there are numerous suggestions, none of them work. We cant use Media Player because we dont want any menu - just the graphic. We dont know why, with the cool tools given in .NET, there is no animation player (seems a huge oversight...) But we need to get "unstuck" on this one, and we need that fast...
So, How does on play a simple AVI file using VB.NET code? What DLL or OCX does Microsoft recommend and is there a place we can find some sample code for it?
View 6 Replies
Apr 20, 2012
Been doing VB2010 for about a year now, have recently started to push the boundary's for what kind of media I can incorporate into my forms. I haven't been able to play .wav or .mp3 files though. I have tried to follow tutorials on microsoft and other coding websites without success.
View 1 Replies
Jul 28, 2010
I'm downloading 3 files from the server using wClient, which goes ok, but I was wondering if the progressbar% is correct.
vb.net
Private WithEvents wClient As New WebClientPrivate WithEvents w2Client As New WebClientPrivate WithEvents w3Client As New WebClient wClient.DownloadFileAsync(New Uri("http://...w2Client.DownloadFileAsync(New Uri("http://...w3Client.DownloadFileAsync(New Uri("http://...' progressbarPrivate Sub wClient_DownloadProgressChanged(ByVal sender As Object, ByVal e As
[Code]...
View 20 Replies
Feb 8, 2012
I'm trying to implement Bandwidth Total calculation into my little desktop monitoring program using 2 *.txt files. Everything else is working great except for the writing/reading part of it. I had put this together originally without the intention of bandwidth monitoring, but I've decided it would be a good thing to have.I want to have 2 monitoring types: Windows Session Bandwidth Total & All-Time Bandwidth Total (since the program was 1st run on the machine). The counter is on a Timer (2nd of 2), and I want it to write and add the label values each second into the file, then when Form3 is opened, to read the text file and show the results.
View 12 Replies
Nov 20, 2008
I have a program that speaks wave files. This works problemless with the Soundplayer class with the following code:
Sub MyPlayWav(ByVal WavFileName As String, ByVal StartPos As Long, ByVal EndPos As Long)
Dim wp as new SoundPlayer
wp.SoundLocation = WavFileName
wp.Play
End sub
The soundplayer does however not seem to have a method to play the wave from position StartPos to position EndPos and achieving just that would mean quite a reduction in downloads of these files.
The soundplayer does have a stream object, and that does have a seek method, suggesting that there might be a way to accomplish this, but how?
I plan to include other media files as I am developping the project, and I guess I will be confronted with the same problem.
View 2 Replies
Jun 19, 2010
I'm working on a To Do List program of sorts. I currently have a CheckedListBox on the form with an Add Button and a Delete Button. I send the items to an array and then use that array to fill in my CheckedListbox. This all works.
I wrote the following code to delete items:
Dim summarylistboxindex As Integer
summarylistboxindex = SummaryListBox.SelectedIndex
MonkeysTasks(summarylistboxindex) = String.Empty
[Code]....
I use a variable called INTCOUNTER to keep track of my position in the array.
My question:
How can I use the second piece of code that deletes multiple items at once from my CheckedListBox AND delete the corresponding entry in the array?
ie if my checkedlistbox items were Apple Orange and Banana
I want to delete Apple and Banana at the same time and then remove them from Fruits(0) and Fruits(2) at the same time they are deleted from the CheckedListBox.
View 4 Replies