Connecting Tech Pros Worldwide Forums | Help | Site Map

Clipboard audio for background play?

AWW
Guest
 
Posts: n/a
#1: Sep 27 '08
Using XP and VB 2005, it seemed like a good idea to
save audio in the clipboard and then play it with backgroundworker.
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.

kimiraikkonen
Guest
 
Posts: n/a
#2: Sep 27 '08

re: Clipboard audio for background play?


On Sep 27, 5:31*am, AWW <wrote:
Quote:
Using XP and VB 2005, it seemed like a good idea to
save audio in the clipboard and then play it with backgroundworker.
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.Audio.Play" as follows:

'Play wav file in background continuously
'Check AudioPlayMode Enum for more options
My.Computer.Audio.Play("c:\sound.wav", AudioPlayMode.BackgroundLoop)

'To stop just call Stop method
My.Computer.Audio.Stop

Hope this helps,

Onur Güzel
AWW
Guest
 
Posts: n/a
#3: Sep 28 '08

re: Clipboard audio for background play?


On Sat, 27 Sep 2008 03:03:24 -0700 (PDT), kimiraikkonen
<kimiraikkonen85@gmail.comwrote:
Quote:
>On Sep 27, 5:31*am, AWW <wrote:
Quote:
>Using XP and VB 2005, it seemed like a good idea to
>save audio in the clipboard and then play it with backgroundworker.
>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.Audio.Play" as follows:
>
>'Play wav file in background continuously
>'Check AudioPlayMode Enum for more options
>My.Computer.Audio.Play("c:\sound.wav", AudioPlayMode.BackgroundLoop)
>
>'To stop just call Stop method
>My.Computer.Audio.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 BackgroundWorker_DoWork the ContainsAudio
returns a False.
Any idea about that? Thanks for any thoughts.
kimiraikkonen
Guest
 
Posts: n/a
#4: Sep 28 '08

re: Clipboard audio for background play?


On Sep 28, 5:13*am, AWW <wrote:
Quote:
On Sat, 27 Sep 2008 03:03:24 -0700 (PDT), kimiraikkonen
>
>
>
<kimiraikkone...@gmail.comwrote:
Quote:
On Sep 27, 5:31*am, AWW <wrote:
Quote:
Using XP and VB 2005, it seemed like a good idea to
save audio in the clipboard and then play it with backgroundworker.
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.
>
Quote:
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...
>
Quote:
However, if you just want to play a WAV file at the background, you
can use "My.Computer.Audio.Play" as follows:
>
Quote:
'Play wav file in background continuously
'Check AudioPlayMode Enum for more options
My.Computer.Audio.Play("c:\sound.wav", AudioPlayMode.BackgroundLoop)
>
Quote:
'To stop just call Stop method
My.Computer.Audio.Stop
>
Quote:
Hope this helps,
>
Quote:
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 BackgroundWorker_DoWork the ContainsAudio
returns a False.
Any idea about that? Thanks for any thoughts.
Same behaviour, If i use BackgroundWorker! 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
Closed Thread