473,671 Members | 2,252 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Build MP3 Player without WMP OCX

8 New Member
hello guys im new here..hope you can help make my first project in visual basic..i want to make a mp3 player in visual basic without using the WMP OCX.. i have started i downloaded a simple mp3 player without WMP OCX and use it as a reference but since it has no tutorial i have to see the codes 1by1 i cant play my project..here's my code..

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub CmdBrowse_Click()
  3. On Error GoTo error
  4.  
  5.  With CDlg1
  6.    'On Cancel do nothing
  7.    .CancelError = True
  8.  
  9.    .DialogTitle = "Browse For MP3 Files"
  10.    .Filter = "MP3 Files (*.mp3) |*.mp3; |Wave Files (*.wav) |*.wav; |Midi Files (*.mid) |*.mid"
  11.    .ShowOpen
  12.    'Handle no filename
  13.    If Len(.FileName) = 0 Then Exit Sub
  14.  
  15.    txtFile.Text = .FileName
  16.    CmdPlay.SetFocus 'Press enter to play
  17.  End With
  18.  
  19. error:  'Do nothing
  20. End Sub
  21.  
  22. Private Sub CmdPlay_Click()
  23. Play
  24. End Sub
  25.  
  26. Private Sub TxtFile_Change()
  27. Dim Ext As String
  28. 'Check if there is a string in txtFile
  29.  If txtFile <> "" Then
  30.     'File extension is the last three letters
  31.     Ext = LCase(Right(txtFile, 4))
  32.     'If extension is supported enable player buttons
  33.     If Ext = ".mp3" Or Ext = ".wav" Or Ext = ".mid" Then
  34.       CmdPlay.Enabled = True
  35.       CmdPause.Enabled = True
  36.       CmdStop.Enabled = True
  37.       CmdRew.Enabled = True
  38.       CmdFF.Enabled = True
  39.       chkLoop.Value = 1
  40.     End If
  41.  Else
  42.     'If no file name disable player buttons
  43.     CmdPlay.Enabled = False
  44.     CmdPause.Enabled = False
  45.     CmdStop.Enabled = False
  46.     CmdRew.Enabled = False
  47.     CmdFF.Enabled = False
  48.     chkLoop.Value = 2
  49.  End If
  50. End Sub
  51.  
when i open i file i gives a error about thet command "Play" i think theres something wrong about it but in my reference player thats the only command in the CmdPlay button
Mar 11 '08 #1
14 3648
debasisdas
8,127 Recognized Expert Expert
What is that Play in your code ?
Mar 11 '08 #2
chokies12
8 New Member
oh your right "Play" Has no value..

how do i declare a value for play?can you kindly help me im new in visual basic..
Mar 11 '08 #3
VBWheaties
145 New Member
oh your right "Play" Has no value..

how do i declare a value for play?can you kindly help me im new in visual basic..
Whats this mp3 player that you downloaded and set a reference to? Need the name of it in order to understand its code.
Mar 11 '08 #4
chokies12
8 New Member
i downloaded this at freevbcode.com "Pocket Player" here's the code im looking at it 1by1 so i can understand how it was made..
Mar 11 '08 #5
chokies12
8 New Member
i cant seem to post the the pocket player code..it seems that its too long so there nothing that appears in my reply..

DL link for the pocket player code
Mar 11 '08 #6
chokies12
8 New Member
please help me with this project..how do i declare a function for play?
Mar 11 '08 #7
chokies12
8 New Member
please help me need your answer about this
Mar 12 '08 #8
Killer42
8,435 Recognized Expert Expert
you need to have some patience. The people who respond here are volunteering their own time, and are located in various timezones around the world.

I'd have a look at the code now, but my work system blocks access when I try to open the link. :-(
Mar 12 '08 #9
chokies12
8 New Member
you need to have some patience. The people who respond here are volunteering their own time, and are located in various timezones around the world.

I'd have a look at the code now, but my work system blocks access when I try to open the link. :-(
oh im sorry about my impatience..im having problem posting the code here since its too long..
Mar 12 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

3
3039
by: steve | last post by:
Sir, Unable to compile this xine player code on visual C++ on windows xp environoment is it only for Linux it is not an assignment. code downloaded from web is as follows /* * Copyright (C) 2000-2002 the xine project
3
3422
by: Kunle Odutola | last post by:
I have a database that tracks players for children's sports clubs. I have included representative DDL for this database at the end of this post. A single instance of this database supports multiple clubs. I would like to add support for letting each club define and store custom information about their players. Basically, allows the clubs to define custom attributes for players (e.g. "height", "weight", "favourite sweet"). A few...
3
4368
by: Kunle Odutola | last post by:
I have a database that tracks players for children's sports clubs. I have included representative DDL for this database at the end of this post. A single instance of this database supports multiple clubs. I would like to add support for letting each club define and store custom information about arbitrary entities. Basically, allows the clubs to define custom entities (i.e tables) and associated custom attributes (i.e. fields) that may be...
0
1159
by: Jon Schwartz | last post by:
Hi all, I found this succint and straightforward example at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay10/mmp_sdk/simpleexampleofscriptinginawebpage.asp : <HTML> <HEAD> </HEAD> <BODY> <OBJECT ID="Player" height="0" width="0" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"> </OBJECT>
1
2297
by: Shane | last post by:
I'm trying to access the media player (V10) mediacollection object from my ..NET web service to return a list of media files. For some reason when i call getByAttribute("MediaType", "Audio") it does not return anything (ie. an empty playlist object), however if i call this using just a normal windows app, it returns all of my audio files as expected. I am suspecting it is using the ASPNET user (ie. default web service user) instead of...
5
21470
by: JulioHM | last post by:
Hi all, I'm trying to use WMP in FireFox and I have the following tag to embed the player into the html page. <EMBED TYPE="application/x-mplayer2" PLUGINSPAGE="http://microsoft.com/windows/mediaplayer/en/download/" ID="wmp" Name="wmp"
3
2915
by: alice | last post by:
I've been trying for a long time to figure this out, to have a page with several MP3 clips, and each one having a custom start and stop button next to them to play the track. I finally found a bit of code that does this, but it's made for only one mp3 file. I don't know enough about javascript to customize the code myself. I know there probably needs to be an "array" of some sort, but I need some help figuring out where and how that works....
1
3524
by: Ringo | last post by:
I'm trying to use windows media player in an app. I can give it an mp3 and it plays it, but if I give it a playlist it will not play and even the play button on the control is not active. btn_open_mediaFile works fine, tn_open_playlist acts likes nothing happened except I see the name of the playlist. What am I missing? Also, if an mo3 is playing, loading a playlist stops it from playing. here is my code
0
8476
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
8821
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...
1
8598
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7437
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
6229
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
4225
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
4407
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2812
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1809
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.