Udostępnij za pośrednictwem


How to: Save an Audio Stream to the Clipboard in Visual Basic

The My.Computer.Clipboard.SetAudio method can be used to save audio data to the Clipboard.

To save audio data to the Clipboard

  • Use the My.Computer.Clipboard.SetAudio method to write audio data to the Clipboard. This example creates the byte array musicReader, reads the file cool.wav into it, and then writes it to the Clipboard.

    Dim musicReader As Byte()
    musicReader = My.Computer.FileSystem.ReadAllBytes("cool.wav")
    My.Computer.Clipboard.SetAudio(musicReader)
    

See Also

Reference

My.Computer.Clipboard Object

My.Computer.Clipboard.SetAudio Method

My.Computer.Clipboard.GetAudioStream Method

My.Computer.Clipboard.ContainsAudio Method

Other Resources

Storing Data to and Reading From the Clipboard