Play audio

DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Play audio

  1. #1
    Join Date
    Feb 2007

    Question Play audio

    Hello im some what new with vb Im wondering how to create a just a Play and stop button and when u click play it will connect to a site like shout cast url or a listen live radio url thanks.

    If tried a sorce code example

    Private Sub Form_Load()
    psSoundFile = AppPath & ""
    If Dir(psSoundFile) = "" Then
    MsgBox "Sample .wav file not found; can't run", , "Error"
    MMControl1.DeviceType = "WAVEAUDIO"
    MMControl1.FileName = psSoundFile
    End If
    End Sub

    and when i click play it says wav file not found etc.

  2. #2
    Join Date
    Oct 2005
    Well I guess AppPath is a variable that contains for example the media player path or some thing similar -if u don't mean "app.path" ; but in both cases if u want to run the wav file embeded in your application u souldn't put any pathes befor the url ;
    I mean [player.exe "http://file.wav"] may be a command to the player to shell it and play specified file and here the player will play separetly and not in your aplication form .
    second the function "DIR()" is checking with a local path not a network path; I mean here pathes with a "\" separator not a "/" like in url or any net-work .
    your if condition will work better if it's like that :
    If psSoundFile <> "" Then
    Programmer&Cracker CS

  3. #3
    Join Date
    Oct 2005
    Sorry if your if condition is for knowing if the file exist originally in the server or not, so u may not use the "dir" and may just try to connect to the path, and if the return is FILE_EXIST u can continue and else check display the error .
    Programmer&Cracker CS

  4. #4
    Join Date
    Aug 2004
    Orange, California
    Try this Demo:
    Playing Sounds in VB: Demo Application

Similar Threads

  1. Creating an audio editing system
    By Neo_IRE in forum Java
    Replies: 0
    Last Post: 02-01-2007, 01:51 PM
  2. How to play an audio file?
    By yhx in forum C++
    Replies: 1
    Last Post: 01-29-2007, 06:08 AM
  3. Outputting an audio file
    By srekcus in forum Java
    Replies: 0
    Last Post: 08-16-2006, 05:42 PM
  4. onmouseover audio
    By Joe in forum Web
    Replies: 0
    Last Post: 09-30-2001, 10:17 PM
  5. New Target Window for link and automatic Play Real Player
    By Sohail in forum Architecture and Design
    Replies: 0
    Last Post: 01-15-2001, 10:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center