473,806 Members | 2,795 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Playing a music file

Ok, hi evryon
now I swear I put this post up yesterday but I cant find it anywhere so ill put it up again
So I'm making a program to play music but the code ive got for the open dialog thing isn't working. This is what iv'e go
\\\\\\\ Private Sub MenuItem2_Click (ByVal sender As System.Object, ByVal e As System.EventArg s) Handles BtnOpen.Clic
Dim OpenFileDialog(
Dim openFile As New System.Windows. Forms.OpenFileD ialo
openFile.Defaul tExt = "mp3
openFile.Filter = "mp3 files (*.mp3)|*.mp3
openFile.ShowDi alog(
Dim filename As Strin
For Each filename In openFile.FileNa me
Nex
End Su
////////
Now when i try to open an mp3 (when im running the program) and it doesnt doing and the program keeps running.
Now someone gave me code for this about a month ago and it didn't work. I also wnat to be able to play ANY music file on my computer like realplayeror media player
Thanx
Nov 20 '05 #1
5 1950
Hi Tom,

This is not really my stuff, sounds for me more for a multimedia student.

However did you try this sdk already?
http://msdn.microsoft.com/library/de...9seriessdk.asp

Cor
Nov 20 '05 #2
* "=?Utf-8?B?VG9tIFc=?=" <an*******@disc ussions.microso ft.com> scripsit:
now I swear I put this post up yesterday but I cant find it anywhere so ill put it up again.
So I'm making a program to play music but the code ive got for the open dialog thing isn't working. This is what iv'e got
\\\\\\\ Private Sub MenuItem2_Click (ByVal sender As System.Object, ByVal e As System.EventArg s) Handles BtnOpen.Click
Dim OpenFileDialog( )
Dim openFile As New System.Windows. Forms.OpenFileD ialog
openFile.Defaul tExt = "mp3"
openFile.Filter = "mp3 files (*.mp3)|*.mp3"
openFile.ShowDi alog()
Dim filename As String
For Each filename In openFile.FileNa mes
Next
End Sub
/////////
Now when i try to open an mp3 (when im running the program) and it doesnt doing and the program keeps running.
Now someone gave me code for this about a month ago and it didn't work. I also wnat to be able to play ANY music file on my computer like realplayeror media player.


The code above doesn't play anything, it just lets you select files.

<URL:http://www.mentalis.or g/soft/class.qpx?id=1>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3
Ok thanx its all going good... almost. when I put thins with "imports" I keep on getting errors syaing " 'Imports' statements must precede any declarations." What does this mean. I'm putting this code for sound files at the bottom of the page after my last end class. What am I doing wrong
Than

Nov 20 '05 #4
"Tom W" <an*******@disc ussions.microso ft.com> schrieb
Ok thanx its all going good... almost. when I put thins with
"imports" I keep on getting errors syaing " 'Imports' statements must
precede any declarations." What does this mean. I'm putting this code
for sound files at the bottom of the page after my last end class.
What am I doing wrong? Thanx


"Precede" means *before*, not *after*.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #5
HI now if I put the the imports bit at the top it works but if I put the namespace bit (media exception) at the top (after imports) it gets this error and doesnt ru
\\\\\\An unhandled exception of type 'System.Resourc es.MissingManif estResourceExce ption' occurred in mscorlib.dl

Additional information: Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. Make sure "Form1.resource s" was correctly embedded or linked into assembly "media player 2"
baseName: Form1 locationInfo: media_player_2. Form1 resource file name: Form1.resources assembly: media player 2, Version=1.0.157 7.36028, Culture=neutral , PublicKeyToken= nul
////////
now when i take the media exception out it works. I checked the folder where the project is and it has a file called "media_player_2 .form1.resource s" when I put the media exception in and debug it changes its name to "media_player_2 .Org.Mentalis.M ultimedia.Media Exception.resou rces" why does it do this. (To find this file i went visaul studio projects\media player 2\obj\debug)
Note if I leave the imports at the top and put the media exception at the bottom (after my last end class) the program runs
Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2499
by: Shelly | last post by:
I have a list of file descriptions in a list box that is filled via a php mysql select. I know the name of the file that is described by the file that is select from that list box. It is an audio file. I have a "Play" button. I know how to get to a section of code when the user clicks that button. Question 1: What do I have to do to make it play on the the user's machine when he clicks the "Play" button. Question 2: When he...
12
16155
by: Marian Aldenhövel | last post by:
Hi, I am trying to make pygame play music on windows. This simple program: import pygame,time pygame.init() print "Mixer settings", pygame.mixer.get_init() print "Mixer channels", pygame.mixer.get_num_channels() pygame.mixer.music.set_volume(1.0) pygame.mixer.music.load('file1.mp3)
4
2183
by: cody | last post by:
Is there a way to play mod-music in .NET? I know in the standardlibraries there is nothing for mod-music but does anybody know of a free third party component that can be used for that? -- cody www.deutronium.de.vu || www.deutronium.tk
4
2414
by: Sumaira Ahmad | last post by:
Hi, Is there any way of playing songs and downloading songs from a server onto a client machine. I want to develop an application such as a music portal which allows clients to play songs that reside on a Web Server. So does the web server need to send the song as an attachment to the ASP.NET Web application or does it do streaming?? And how is it achieved?? Please any ideas or any hints will be highly appreciated.
1
1503
by: Tom W | last post by:
hi I've found some code for playing sounds and it kinda works. This is what I have \\\\\Public Class SoundClas Declare Auto Function PlaySound Lib "winmm.dll" (ByVal name As String, ByVal hmod As Integer, ByVal flags As Integer) As Intege ' name specifies the sound file when the SND_FILENAME flag is se ' hmod specifies an executable file handl ' hmod must be Nothing if the SND_RESOURCE flag is not se ' flags specifies which flags are se...
3
2377
by: Tommy DN | last post by:
I've made a program that displays the track that's playing on a (internet)radiostation. The name of the "now playing" track comes from the radiostation's website ( from the statusbar using the Internet Explorer object model ). Now, I want the name of the track in the person's nickname from MSN Messenger ( the "now playing" info that actually comes from the Windows Media Player Music Plugin ). Does anybody know how to do that ( in VB.Net...
14
4022
by: gnarl | last post by:
Hello all, I'm developing a site in PHP4 for a music artist, who wants music to play across all their pages. I have loaded a simple flash applet to play the music, but every time the visitor to the site moves to a different page the music starts again. The artist would like the music to play continuously. I can only think of three possible ways to solve this, and I am not happy with any of them.
11
2186
Death Slaught
by: Death Slaught | last post by:
i need a music player on my site ive tried the embed tag but i cant ever get the music to play also i would like to have script that lets my users download a file but i know nothing about downloading script so im not asking for a script but help learning how to make one. Thanks, Death Slaught
2
1514
by: sumaabey | last post by:
Thanks in advance. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
0
9719
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9599
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10624
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5684
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3853
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.