473,382 Members | 1,651 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Random sounds/Embedding project files into self-containing exe

I know how to play a single sound, but I need code that will play any unset number of sounds at random intervals, and at random times. Also, I need to know how to embed these sounds and other project files into a self-containing exe program so I only have to distribute the exe file and not the external sounds, etc. Thanks.
Feb 7 '07 #1
7 1446
willakawill
1,646 1GB
Interesting. Looks like you want to create a really irritating exe file. Can't be done to my knowledge. You can't compile external files into an exe file like that.
Feb 7 '07 #2
Someone else told me to use resource files to do that part, but how do I generate random sounds?
Feb 7 '07 #3
willakawill
1,646 1GB
You said an unset number of sounds. In order to include sound files in your app you need to have a set number. To play them randomly you would use a timer and reset it using Rnd. You would also use Rnd to select which file to play.
Feb 7 '07 #4
Killer42
8,435 Expert 8TB
Someone else told me to use resource files to do that part, but how do I generate random sounds?
I'm a little vague on the meaning here. Do you want to literally generate "random sounds" or do you have a bunch of sounds, that you want to play at random?

If the former, I don't think VB supports the old play a tone of pitch x and duation y type of statements that earlier versions of BASIC had. Kind of a shame, really.
Feb 8 '07 #5
GBJim
2
I'm a little vague on the meaning here. Do you want to literally generate "random sounds" or do you have a bunch of sounds, that you want to play at random?

If the former, I don't think VB supports the old play a tone of pitch x and duation y type of statements that earlier versions of BASIC had. Kind of a shame, really.
Know of any code that duplicates that BASIC function in C++?
Would appreciate any help.

Jim <E-mail address removed>
Jul 7 '07 #6
Robbie
180 100+
I don't think VB supports the old play a tone of pitch x and duation y type of statements that earlier versions of BASIC had. Kind of a shame, really.
It most definately can still do that! :P
Just need to use this:
Expand|Select|Wrap|Line Numbers
  1. Public Declare Function Beep Lib "Kernel32" _
  2.   (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Then use
Expand|Select|Wrap|Line Numbers
  1. Beep Frequency, Miliseconds
  2.  
It's at the heart of my program 'Bleeper Music Maker'. ;)

Although, I don't think he was talking about using the bleepy PC speaker. ><

EDIT: Forgot to mention - that only works on XP! Other versions ignore the frequency and duration parameters, making it totally useless for my needs. XD
Jul 7 '07 #7
Killer42
8,435 Expert 8TB
It most definately can still do that! :P
My point is still valid, though. VB doesn't have the statement to play a sound any more - you have to track down an API call. Thanks for the info, though. I might add that to the Articles section.
Jul 8 '07 #8

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

Similar topics

28
by: Paul Rubin | last post by:
http://www.nightsong.com/phr/python/sharandom.c This is intended to be less predicable/have fewer correlations than the default Mersenne Twister or Wichmann-Hill generators. Comments are...
7
by: Robin Becker | last post by:
We've been queried about the randomness of some filenames we're producing. I worked through and seemed to satisfy myself that random is being initialised from the system time in C time(&now)...
26
by: Chris Lasher | last post by:
Hello, I have a rather large (100+ MB) FASTA file from which I need to access records in a random order. The FASTA format is a standard format for storing molecular biological sequences. Each...
5
by: Raterus | last post by:
I'm just throwing this error out for my sanity, I've seen posts about this, but never solutions. I'm using VS.NET 2003, Framework 1.1, and I'm getting a random error about every 1 out of 10 times...
1
by: Kakacek | last post by:
Hello All, Let's say I have a following python code: class hw_class: def __init__(self): pass def hello_world(self): print 'Hello World!' create_instance('hw_class', 'hw')
0
by: Fozzie | last post by:
Hi, I have a problem which is quite circular, and hopefully either someone has encountered something similar or has a reason why this will not work. We have a COM library providing...
4
by: tshad | last post by:
I am trying to set up an Image authorization where you type in the value that is in a picture to log on to our site. I found a program that is supposed to do it, but it doesn't seem to work. ...
0
by: Soren | last post by:
Hi, I've been trying to embed matplotlib in wxpython. I want to be able to put a figure (axes) in a wx.Panel and place it somewhere in my GUI. The GUI should have other panels with buttons etc....
15
by: caca | last post by:
Hello, This is a question for the best method (in terms of performance only) to choose a random element from a list among those that satisfy a certain property. This is the setting: I need to...
0
by: Tim Spens | last post by:
--- On Fri, 6/27/08, Tim Spens <t_spens@yahoo.comwrote: I think I know where the problem is but I'm unsure how to fix it. When I call Register_Handler(...) from python via...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.