|
-
Aug 31st, 2000, 10:51 AM
#1
Thread Starter
Junior Member
I want my application to have a wave file in it i know that it is can be by a resource file but using images and icons files . like that i need my project to have itself and its wave files in one files and i could to play then also even by converting then to alone-standing files before playing them
-
Aug 31st, 2000, 11:02 AM
#2
Take a look at this example from www.planet-source-code.com. The author says that you can embed wav files in your exe.
-
Aug 31st, 2000, 11:10 AM
#3
I don't know if I understand you correctly. Do you want to include a wave file in your Exe an then have your Exe file write the wave file back to the disk?
If this is want you want then open up the resource editor and click on the "Add Custom Resource..." button on the toolbar.
Select your wave file and click OK.
Now in the treeview you will see a node called "Custom" and as a child node of that you will have your resource with a special ID.
This code sample assumes the ID is 101.
Code:
Public Sub SaveWavFile(sFilename As String)
Dim bArr() As Byte
Dim iFile As Integer
iFile = FreeFile
Open sFilename For Binary Access Read As #iFile
bArr = LoadResData(101, "CUSTOM")
Put #iFile, , bArr
Close #iFile
End Sub
Now you can call SaveWavFile like this:
Code:
SaveWavFile "c:\MyWave.wav"
Good luck!
-
Aug 1st, 2002, 12:35 PM
#4
Thread Starter
Junior Member
done well but the sound quality is very poor
-
Aug 1st, 2002, 01:03 PM
#5
Thread Starter
Junior Member
-
Aug 1st, 2002, 01:42 PM
#6
Black Cat
Unfortunate my sample code is MIA, but it is possible to store a wav file in your exe's resource file, load the wav file into a string buffer in memory at runtime, then use the WinMM (IIRC) API to play the wav from the string buffer directly from memory.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Aug 2nd, 2002, 06:44 AM
#7
Thread Starter
Junior Member
i done , but the quality is bad
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|