Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 10th, 2007, 04:00 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default Sending data to the audio-output device

Clearly the sundcard in a computer can handle a stream of data, since this is what happens when a .wav file is run in Windows Medium player (or whatever). I also am confident that the soundard plays a role in setting the speed at which the data arrive, otherwise the sound of the file would vary, depending on disk rotation speed, communication channel speed, and other hardware related potential bottlenecks.

Now, what I’d like to do is create a random stream of data to send to the soundcard, to generate uninterrupted white noise.

If I had a file of white noise, I could play that through Windows Medium Player (the name that app would have if Microsoft could speak English...), and set it to loop continuously, but there is a break in the sound when it “rewinds,” and if the sound file has a different sound at the beginning and end, there is a “shift” in the sound as it moves from the end back to the beginning.

I want to generate the data for the sound myself. But how do I send it to the sound-playing device?

I want to create a rushing noise to mask out the drivel that those around me talk about throughout the day.

Once I get this to work, perhaps I'll add some modulation to create different effects, like a bird chirp, rainfall vs a waterfall, ocean waves or the kind of machinery background that the original Star Trek had.

But the first thing (naturally) is to establish effective communication with the sound card...
 
Old January 10th, 2007, 04:08 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

white noise can't mask people chatting unless it is very loud :)
are you planning to listen to that with earphones?
Just curious... I just use my iPod when people arounf me are too noisy, and for me is is much better listening to The Clash than a white noise that reminds me of an airplane!

Anyway, see if this article can help you:
http://www.vbaccelerator.com/home/VB...er/article.asp
it explains the different ways to stream data to the soundcard (I use the MCI API library, very easy to use in VB)

"There are two ways to write error-free programs. Only the third one works."
Unknown
 
Old January 11th, 2007, 06:46 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Well, that looks like it will be instructive. :)

Unfortunately :(, the project generates numerous errors when I load it , so there will be the additional instructiveness that fixing software-written-by-someone-else-that-doesn’t-work-for-me carries, as well...

(Bored, so I thought I’d try out the faces as sign language...)





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in e-mail structure sending data from data tiawebchd General .NET 3 May 5th, 2008 08:07 AM
data output kciwzehc Access 5 November 28th, 2007 01:10 PM
Problem when reading data from a USB device makTSPL C# 2005 0 August 4th, 2007 12:12 AM
sending streaming audio files to client browser hotshot_21 ASP.NET 1.0 and 1.1 Professional 1 March 28th, 2006 12:29 AM
Sending output to HTML table mairejo Classic ASP Basics 3 September 20th, 2004 10:02 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.