Use A Relative Path To Play A WAVE File?

Aug 6, 2010

Firstly, I'm a Chinese Beginner of Visual Basic. I try my best to express my worries and demands. If anything is vague, I want to design a program like this: when clicking the button, the computer will play certain sound. Like this:(VB 2010) Private Sub con_sndplay_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles PLAY.Click

View 3 Replies


ADVERTISEMENT

Forms :: Audio.Play Relative Path?

Mar 25, 2009

I need to play a sound file: Soundsopen_creaky_door.wav"

However the code only works if I specify the EXACT location:

My.Computer.Audio.Play("c:soundsopen_creaky_door .wav")

Is there a way I can set the relative path to something like this?

My.Computer.Audio.Play("soundsopen_creaky_door.w av")

View 3 Replies

Wave File Won't Play?

Oct 4, 2008

So, I re did my project in VB.NEt instead of C#. So, I put all the sound files in the resource files. I made a routine to play the sound file but it says that to make sure the sound file exists. Which it does because it played in the resource manager.Here's the sub routine to play the sound:

Dim sndplayer As New Media.SoundPlayer
Public Sub TestSound(ByVal snd As String)
My.Computer.Audio.Play(snd)

[code].....

View 3 Replies

Access A File Using Relative Path Or Virtual Path?

May 22, 2012

I am trying to read and display a file using MapPath as follows :

Response.ContentType = "Application/pdf"
Dim FilePath As String = MapPath("../Document/123.pdf")
Response.WriteFile(FilePath)
Response.End()

This procedure will work fine and display in the browser. However, if I save the file to C:Document123.pdf, how can I access this file using relative path in MapPath function. Is there an option to access the file which is saved out of IIS server? I am using vb.net 2003.

View 1 Replies

Write A Program To Alter The Pitch Of A Wave File To A Specified Frequency And Play The Altered Wav Back

Dec 23, 2011

links that may point me in the right direction to accomplish the task listed in the title,

View 5 Replies

Set The Relative Path Of A Exe File In .net?

Feb 11, 2010

set the relative path of a exe file in .net?

View 11 Replies

Make A File Path Relative?

Jul 3, 2009

I have a file path like this:

C:Documents and SettingsusernameMy DocumentsProgram NameFormDataGForm1Music.mp3

I need to change it from that to this:FormDataGForm1Music.mp3

The only problem is, that the rest of the file path could change but that.

View 2 Replies

Open PDF File With A Relative Path?

Aug 4, 2009

I am working with Visual Studio 2008 to concieve a small program.pdf file is supposed to open when a button is pressed. It work great with the code:

System.Diagnostics.Process.Start("<Full File Path>")

Only, I would like to place the pdf file in the project's folder and that would open wherever the project's folder is (on the Desktop, a USB port, anywhere).

1- How to get this relative path?

2- in which folder to put the pdf?

View 3 Replies

Way To Make File Path 'relative'

Aug 17, 2009

I have a form with a tabbed control on it. Each tab in the control simply loads an existing file in a reader to display to the user. I have added the files in a folder in my project. When I debug it works great. However, when I publish and move it to another computer, the program runs fine but none of the files show in the tab control tabs. The files do come with the solution when I publish.[code]I know there is a way to make the file path "relative" but I cannot figure out how and there really isn't many resources available to explain how this can be done.

View 2 Replies

Relative Path To Create Setup File?

Jun 10, 2011

I have completed my VB project using vb 2008 express edition..I am not able to create a set up file for my project and I think it is because of the file path i have provided in my program

dbSource = "Data Source = C:Documents and SettingscfadminDesktopLead_managementLead_Management_ProjectLead_Management_ProjectLondon.mdb"

The above path is a fixed path which connects my program to the database. Now when I create a set up file and try to run on another machine it wont recognize this path . have placed the database in the same folder that of the program.

View 1 Replies

How To Find Relative Path Of Batch File For Access

Jan 11, 2010

In vb.net, when writting an application, I want to access a batch file that has been added to the project. My question is how to I find the relative path of this file to access it? I have used relative path on the ASP.NET side, but not on the application side. The properties that I am finding regarding the current directory and running directory and the likes are all for the bin directory its in. While I can use the CurrentDirectory() property and go up two parents (....) in the development environment, when I install the application, the structure is not the same. As in the output is in a single folder, not tiered.

Example. c:projectsMyAppindebugMyApp.exe is the running directory
My file I want to access is at c:projectsMyAppvalidate.bat
so "c:projectsMyApp" is what I am trying to capture.

View 1 Replies

Running .exe's; Read File Into Array; Relative File Path

Apr 22, 2012

I am trying to create a sort of 'personal code library' in visual studio 2010 where the form displays a list box of certain project files in vb that I have made in the past and when selected, a button can be pressed that launches the .exe files of those visual basic program project files or displays the source code (.vb file)

[Code]...

View 1 Replies

Execute A Batch File Using A Relative Path Added To The Project

Aug 25, 2010

i have created a batch file and have added it to the project using add items. Basically what i am aiming at is to execute this file on a button click action. I am using System.Diagnostics.Process.Start("hello.bat") command to run this file i have changed the build action to resource for this batch file. But when i run this program, it is not able to locate the batch file. I am required to give a relative path as the path my vary from machine to machine. how can i make this file accessable using a relative path?

View 1 Replies

Listbox - Select The File To Play But It Displays The File Path?

May 8, 2010

I made a media player that has a list box to select the file to play but it displays the file path but I want the filename and length.The code is:

Private Sub ListBox1_SelectedIndexChanged(ByVal sender
As System.Object,
ByVal e As System.EventArgs)[code].....

View 18 Replies

URL Getting Absolute Path From Relative Path ?

Mar 7, 2011

Say URL1: http:[url].....
RelativePath: ../../hello.htm

Hence absolute path is http:[url].....

Is there a function that do that?

View 3 Replies

Relative Path Name In .NET?

Jun 10, 2011

I'm trying to open a text file in a program I've created but it won't work unless I specify it as an absolute file path. I can't seem to make a relative path name.

View 3 Replies

Relative Path To An Image?

Sep 19, 2010

i am trying to create an application with with a tree view on the left and a list view on the other (which functions like a explorer )but i need a folder icon in both tree vies and list view it is only working as complete path C:Documents and Settings6025DesktopAccessProviderclose.jpgbut when you deploy this application the location always changes where shall i copy my images? and how can i locate itPlease see my code

Private Sub AddAllFolders(ByVal TNode As TreeNode, ByVal FolderPath As String)
Dim imageListSmall As New ImageList()
TreeView1.ImageList = imageListSmall

[code].....

View 4 Replies

Relative Path Names VB2010

Apr 21, 2011

I'm trying to write a little Jukebox application in VB Forms, and I need the pathnames of the sound files (inTracks"Insert Name Here") to be relative instead of absolute, so that it may work on a different computer to mine. At the moment, I am testing with the simple Soundplayer class, and the single line of code to play a song is this: My.Computer.Audio.Play("inTracks" & txtCurrentlyPlaying.Text) It works when, instead of inTracks, I put the full pathname (C:Documents And Settings etc.), but not when I try a relative path such as this.

View 1 Replies

Setting A Relative Path For A Database?

Jun 11, 2010

i have so far set up a form to save data into a database and i am using:

[Code]....

View 4 Replies

Setting A Relative Path To A Database?

Mar 11, 2010

i have so far set up a form to save data into a database and i am using:

con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0.;" & _
"Data Source = F:Database1.mdb"
con.Open()

I tried saving the database as i did with images in the resource folder and used my.resources but this didnt work is there any way i can save the database into the project folder and link to it no matter whan machine i am on?

View 5 Replies

Sql - Relative Path Connection String .net?

Mar 30, 2011

Possible Duplicate: SQL Express Connection string - Relative to application location

I have a desktop application written in vb.net. The app uses an SQL Server express 2008 database (.mdf file).Currently i have the connection string as absolute path like this:

Dim ObjConnection As New SqlConnection("Data Source=.SQLEXPRESS;AttachDbFilename=C:UsersPantheoDocumentsVisual Studio 2010ProjectsFood Manager 2012(new)Food Manager 2012Food_CustomerDB.mdf;Integrated Security=True;User Instance=True")

[Code]...

View 5 Replies

Sql - Relative Path Connection String?

Jun 5, 2012

Possible Duplicate: SQL Express Connection string - Relative to application location I have a desktop application written in vb.net. The app uses an SQL Server express 2008 database (.mdf file).Currently i have the connection string as absolute path like this:

Dim ObjConnection As New SqlConnection("Data Source=.SQLEXPRESS;AttachDbFilename=C:UsersPantheoDocumentsVisual Studio 2010ProjectsFood Manager 2012(new)Food Manager 2

[code].....

View 1 Replies

My.computer.audio : Get It To Play Other Files Besides Just .wav, Like .mp3. Wave Files?

Sep 13, 2008

how can i get it to play other files besides just .wav, like .mp3. wave files are way too large to be used easily if you want a good quality. why cant i play .mp3 files with it?when i convert a 2.1 mb mp3 file to .wav it turns out to be 36 mb?any other ways besides computer.audio to play audio files on command?

View 1 Replies

Load An XML Document Using A Relative Path In Program?

Aug 10, 2009

In VB.net when loading in XML documents using System.Xml.Xmldocument is there a way that I can specify a relative path to the file?[code]...

The XML doc I'm trying to load is in the same directory as the VB class. But I'm having trouble accessing it without using a full path to the XML doc.

View 2 Replies

Relative Path And Accessing Text Files?

May 1, 2011

I have created a sub folder (named 'Data') under my project through the solution explorer. I also have created a text file (data.txt) inside the new sub folder. This text file is used to store information such as settings and connections.

I can check the file using the full path. However, I want to avoid errors such as moving the project folder to a different location. Is there anyway to check using a relative path? File.Exists("~Datadata.txt")

Or is it better to create it under Application.StartupPath?

View 10 Replies

Error When Changing Path Connect To Database As Relative

Jan 12, 2010

I created a project in vb.net which is connected with database. The problem appeared when i changed the path which connect with the database, i made it relative. So some of the forms which contain the connection are working properly but in one form i got this error: [Code]

View 10 Replies

Define A Relative Path For 'Start External Program' In VS 2010 Project?

Oct 4, 2010

I know that here there is a similar question but I would like, if possible, to be able to define a relative path for 'Start External Program' or any workaround that do not constrain me to add a complete new empty project to my solution. I am using VB.NET in Visual Studio 2010 environment developing WinForms apps.

View 4 Replies

Shell - Media Player Play File Error - Refuses To Play

Sep 16, 2010

Im trying to open media player (full screen) and play a movie. When i create the file path like so: Dim MoviePathVTS As String = String.Concat("""" + tempMoviePath, " \VIDEO_TS\VTS_01_1.VOB" + """")

It wont play the file but if i do it like this: Dim video1 = """F:\Movies\DvD\Angels and Deamons\VIDEO_TS\VTS_01_1.VOB"""

It plays fine? the file paths are the same including the extra "" but it just refuses to play. I need the top one because i have many movies in a treeview.

Heres my code

Private Sub watchNow_Click(ByVal sender As Object, ByVal e As EventArgs)

'get the position of the selected node
Dim i = movieTreeView.SelectedNode.Index

[CODE]...

View 2 Replies

What's In A Wave File

Jun 17, 2009

I am trying to convert a mp3 to wav and I need to know...What is the very first thing you see when you open a wave file up? the 2nd, the 3rd, 4th and so on. Is it the riff header or the riff header contents(ID, size, Type). I need this info for a Regex string that would look something like this...

'Frame/MaxFrame (PercentDone%) | CPU time/estim | REAL time/estim | play/CPU | ETA
Private Shared _regLine As Regex = New Regex( _
"(d+)/(d+)D+(d+)D+([d:]+)D+([d:]+)D+([d:]+)D+([d:]+)D+([d.]+)D+([d:]+)"

[code]....

I am executing lame.exe from a process.Start command.VB 6.0, VBExprss, ASP,Net, & Gaming

View 9 Replies

OleDb - Make Path To Database Relative And Save Database?

May 1, 2012

1. First off, how do I make my path to my database relative? The path is currently absolute and is: Data Source=J:/College/AS_DSFinalDatabase1.accdb

2. Second of all, where do I save my database in the project? I want it to be included in like project folders...kind of like the App_Data folder in ASP.Net.

3. I'm recieving an error whenever I try to populate more than 1 DataGridView upon form load for some reason...I've tried 5 different ways of writing the code, and I get the same error...there's no error description, so does anyone know what the issue is? Here's the error:

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved