473,569 Members | 2,844 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Clipboard audio for background play?

AWW
Using XP and VB 2005, it seemed like a good idea to
save audio in the clipboard and then play it with backgroundworke r.
Cannot find a good Clipboard audio example anywhere - just SetAudio
and GetAudio. And an example seems to do a SwapAudio which makes no
sense.
Basically I want to spool or simulate spooling of audio.
So is this reasonable for asynchronous audio clip play? or alternate?
Any thoughts or pointers to other sources? Thanks.
Sep 27 '08 #1
3 3437
On Sep 27, 5:31*am, AWW <wrote:
Using XP and VB 2005, it seemed like a good idea to
save audio in the clipboard and then play it with backgroundworke r.
Cannot find a good Clipboard audio example anywhere - just SetAudio
and GetAudio. And an example seems to do a SwapAudio which makes no
sense.
Basically I want to spool or simulate spooling of audio.
So is this reasonable for asynchronous audio clip play? or alternate?
Any thoughts or pointers to other sources? Thanks.
AWW,
You can take a look at Clipboard's overloaded SetAudio and
GetAudioStream methods as follows:
http://msdn.microsoft.com/en-us/libr...io(VS.80).aspx
http://msdn.microsoft.com/en-us/libr...am(VS.80).aspx

However, if you just want to play a WAV file at the background, you
can use "My.Computer.Au dio.Play" as follows:

'Play wav file in background continuously
'Check AudioPlayMode Enum for more options
My.Computer.Aud io.Play("c:\sou nd.wav", AudioPlayMode.B ackgroundLoop)

'To stop just call Stop method
My.Computer.Aud io.Stop

Hope this helps,

Onur Güzel
Sep 27 '08 #2
AWW
On Sat, 27 Sep 2008 03:03:24 -0700 (PDT), kimiraikkonen
<ki************ *@gmail.comwrot e:
>On Sep 27, 5:31*am, AWW <wrote:
>Using XP and VB 2005, it seemed like a good idea to
save audio in the clipboard and then play it with backgroundworke r.
Cannot find a good Clipboard audio example anywhere - just SetAudio
and GetAudio. And an example seems to do a SwapAudio which makes no
sense.
Basically I want to spool or simulate spooling of audio.
So is this reasonable for asynchronous audio clip play? or alternate?
Any thoughts or pointers to other sources? Thanks.

AWW,
You can take a look at Clipboard's overloaded SetAudio and
GetAudioStre am methods as follows:
http://msdn.microsoft.com/en-us/libr...io(VS.80).aspx
http://msdn.microsoft.com/en-us/libr...am(VS.80).aspx

However, if you just want to play a WAV file at the background, you
can use "My.Computer.Au dio.Play" as follows:

'Play wav file in background continuously
'Check AudioPlayMode Enum for more options
My.Computer.Au dio.Play("c:\so und.wav", AudioPlayMode.B ackgroundLoop)

'To stop just call Stop method
My.Computer.Au dio.Stop

Hope this helps,

Onur Güzel
OK, that is the way it should work but I have SetAudio in the
"foreground " and even checked immediately for ContainsAudio and get a
True response. But in BackgroundWorke r_DoWork the ContainsAudio
returns a False.
Any idea about that? Thanks for any thoughts.
Sep 28 '08 #3
On Sep 28, 5:13*am, AWW <wrote:
On Sat, 27 Sep 2008 03:03:24 -0700 (PDT), kimiraikkonen

<kimiraikkone.. .@gmail.comwrot e:
On Sep 27, 5:31*am, AWW <wrote:
Using XP and VB 2005, it seemed like a good idea to
save audio in the clipboard and then play it with backgroundworke r.
Cannot find a good Clipboard audio example anywhere - just SetAudio
and GetAudio. And an example seems to do a SwapAudio which makes no
sense.
Basically I want to spool or simulate spooling of audio.
So is this reasonable for asynchronous audio clip play? or alternate?
Any thoughts or pointers to other sources? Thanks.
AWW,
You can take a look at Clipboard's overloaded SetAudio and
GetAudioStream methods as follows:
http://msdn.microsoft.com/en-us/libr...forms.clipboar...
http://msdn.microsoft.com/en-us/libr...forms.clipboar...
However, if you just want to play a WAV file at the background, you
can use "My.Computer.Au dio.Play" as follows:
'Play wav file in background continuously
'Check AudioPlayMode Enum for more options
My.Computer.Aud io.Play("c:\sou nd.wav", AudioPlayMode.B ackgroundLoop)
'To stop just call Stop method
My.Computer.Aud io.Stop
Hope this helps,
Onur Güzel

OK, that is the way it should work but I have SetAudio in the
"foreground " and even checked immediately for ContainsAudio and get a
True response. But in BackgroundWorke r_DoWork the ContainsAudio
returns a False.
Any idea about that? Thanks for any thoughts.
Same behaviour, If i use BackgroundWorke r! Playing the stream simply
in a button1_click returns True if the audio is on clipboard. My guess
(just prediction) that, when you try to invoke Background object,
clipboard gets changed or modified and audio data on clipboard is no
longer available to be found. Maybe there are better explanations.

HTH,

Onur Güzel
Sep 28 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
11456
by: LG | last post by:
Just have a question with regards to the clipboard, and how to read what other applications (Adobe InDesignCS) place in the clipboard. I am currently in the process of creating a booklet from a database, and I need the data to be laid out in a tabular format, and set out in a specific way. At the current point in time, I am copy/pasting the...
2
2487
by: Bruce Bon | last post by:
The class below is intended to play a Sun audio file (.au) in the background while the main thread, which is servicing a GUI, continues without impact. It doesn't work. For a sound file that takes 3-5 seconds to play, the main thread hangs for that long. I have run this many times, with changes in printouts and insertion of strategic...
21
7293
by: Steve K | last post by:
Hi, I'm designing a website for the Cornell Undergraduate Business Program where the client wants faculty and student profiles to be interspersed throught the site. These profiles are contained in small boxes or tables with their bio or a statement from the student, etc., etc. The client wants an audio clip to play when the user clicks...
4
1796
by: Isaac Grover | last post by:
Hi everyone, I have recorded some conference calls for my business partners, put them online in Shockwave audio format using a player available from Shockwave. And I'm encountering an annoying problem. When someone connects to my page at http://users.myexcel.com/igrover/wednesday-recordings/ using Internet Explorer, even though the...
1
2679
by: laredotornado | last post by:
Hello, I want to play an audio file embedded on my page by clicking on an audio image and the page change to a new page. Is there a cross-browser Javascript way to do this? Right now the code I have is ... <html> <head> <title>Dictionary: homeostasis</title> <link href="liveink.css" type="text/css" rel="stylesheet"/> </head>
0
2337
by: laredotornado | last post by:
Hello, I want to play an audio file by clicking on an audio icon and not having the page switch out underneath. Right now the code I have is ... <html> <head> <title>Dictionary: homeostasis</title> <link href="liveink.css" type="text/css" rel="stylesheet"/> </head> <body>
2
7877
by: hzgt9b | last post by:
Using VS2003, VB.NET, BACKGROUND I have a window forms based application that will be distributed and executed directly from CD media. The app contains a TreeView control and a WebBroswer (AxSHDocVw.AxWebBrowse) control. The TreeView is populated with nodes that when clicked play an audio clip that is stored on the CD and navigate the...
13
4857
by: anil.rita | last post by:
When the user chooses an AV file to play, based upon the type of file, I want to use the default installed media player to play it. I am wondering if this is a good way - any alternatives, suggestions or improvements? if( wmv file) document.write("<OBJECT id=Player classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 height="354"...
1
1731
by: =?Utf-8?B?Qm9iQWNoZ2lsbA==?= | last post by:
I am using Windows Media Player to play my half second audio files one after the other using the code below... My problem comes when I play a second audio file immediately after the first one stops sometimes on slower computers the audio on the second file gets truncated on the beginning of playing the second file. What can I do to...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7922
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8119
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7668
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.