Hi

Does anyone know how to place sound in a vb.net project? Thanks

Re: Sound in VB.net 80 80

Does anyone know how to place sound in a vb.net project?

If I take that literally, you're asking about embedding an audio resource? You do that from "Project" menu -> "<prjname> Properties" -> "Resources" tab, and there you select resource type (Audio) and the resource source (usually a file).

Or do you mean, how to play audio? The simplest form to play audio is My.Computer.Audio.Play() and that's an overloaded method, so the audio source can be almost anything (like a file, stream or a byte array). The method is however limited to wav-format.

More complex ways are setting a reference to Microsoft.DirectX (.NET) components or Windows Media Player (COM) components.

Re: Sound in VB.net 80 80

Hi

I meant to play an audio file, is it really that easy? Just one line of code?

I'll try it out. Thanks Teme64!

Re: Sound in VB.net 80 80

just import the namespace as
Imports System.Media

declare the object of SoundPlayer

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.